当前位置: 首页>>代码示例>>C#>>正文


C# HtmlTextWriter.WriteFullBeginTag方法代码示例

本文整理汇总了C#中System.Web.UI.HtmlTextWriter.WriteFullBeginTag方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTextWriter.WriteFullBeginTag方法的具体用法?C# HtmlTextWriter.WriteFullBeginTag怎么用?C# HtmlTextWriter.WriteFullBeginTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.UI.HtmlTextWriter的用法示例。


在下文中一共展示了HtmlTextWriter.WriteFullBeginTag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShowPropertyGrid

        /// <summary>
        /// Creates a simplistic Property Grid to display of an object
        /// </summary>
        /// <returns></returns>
        public static string ShowPropertyGrid(object sourceObject)
        {
            if (sourceObject == null)
                return "<hr/>No object passed.<hr/>";

            StringBuilder sb = new StringBuilder();
            using (StringWriter sw = new StringWriter(sb))
            {
                using (HtmlTextWriter hWriter = new HtmlTextWriter(sw))
                {
                    hWriter.WriteBeginTag("table");
                    hWriter.WriteAttribute("border", "1");
                    hWriter.WriteAttribute("cellpadding", "5");
                    hWriter.WriteAttribute("class", "table table-bordered table-striped");
                    hWriter.Write(" style='border-collapse:collapse;'");
                    hWriter.Write(HtmlTextWriter.TagRightChar);
                    MemberInfo[] miT = sourceObject.GetType().FindMembers(MemberTypes.Field | MemberTypes.Property, BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly, null, null);
                    foreach (MemberInfo Field in miT)
                    {
                        string Name = Field.Name;
                        object Value = null;
                        if (Field.MemberType == MemberTypes.Field)
                        {
                            Value = ((FieldInfo)Field).GetValue(sourceObject);
                            continue;
                        }
                        else
                            if (Field.MemberType == MemberTypes.Property)
                                Value = ((PropertyInfo)Field).GetValue(sourceObject, null);
                        hWriter.WriteFullBeginTag("tr");
                        hWriter.WriteFullBeginTag("td");
                        hWriter.Write(Name);
                        hWriter.WriteEndTag("td");
                        hWriter.WriteLine();
                        hWriter.WriteFullBeginTag("td");
                        hWriter.WriteBeginTag("input");
                        hWriter.WriteAttribute("name", "Configuration." + Name);
                        hWriter.WriteAttribute("value", ReflectionUtils.TypedValueToString(Value));
                        hWriter.Write(" style='Width:400px' ");
                        hWriter.Write(HtmlTextWriter.TagRightChar);
                        hWriter.WriteEndTag("td");
                        hWriter.WriteLine();
                        hWriter.WriteEndTag("tr");
                        hWriter.WriteLine();
                    }
                    hWriter.WriteEndTag("table");
                    //string TableResult = sb.ToString();
                    hWriter.Close();
                }
                sw.Close();
            }

            return sb.ToString();
        }
开发者ID:Acaspita,项目名称:Westwind.ApplicationConfiguration,代码行数:58,代码来源:SamplesViewModel.cs

示例2: Store

 public override void Store(HtmlTextWriter w)
 {
     base.Store(w);
     string ls = _language.ToString().ToLower();
     w.AddAttribute(HtmlTextWriterAttribute.Name, "code");
     w.AddStyleAttribute(HtmlTextWriterStyle.Overflow, "auto");
     w.RenderBeginTag(HtmlTextWriterTag.Span);
     w.AddAttribute(HtmlTextWriterAttribute.Class, ls);
     w.WriteFullBeginTag(string.Concat("pre><code class=\"", ls, "\""));
     w.Write(HttpUtility.HtmlEncode(_text));
     w.WriteFullBeginTag("/code></pre");
     w.RenderEndTag();
 }
开发者ID:supermuk,项目名称:iudico,代码行数:13,代码来源:WebHighlightedCode.cs

示例3: RenderChildren

        protected override void RenderChildren(HtmlTextWriter writer)
        {
            writer.WriteFullBeginTag("span");
            writer.WriteFullBeginTag("i");
            writer.Write("Pimp your SharePoint by using ton's of sample data.. ");
            writer.WriteBeginTag("br");
            writer.Write(HtmlTextWriter.SelfClosingTagEnd);
            writer.Write("Just hit the buttons to add sample data.");
            writer.WriteEndTag("i");
            writer.WriteEndTag("span");
            writer.WriteBeginTag("br");
            writer.Write(HtmlTextWriter.SelfClosingTagEnd);

            base.RenderChildren(writer);
        }
开发者ID:ThorstenHans,项目名称:DotNetRocks,代码行数:15,代码来源:DeploySampleData.cs

示例4: Render

        protected override void Render(HtmlTextWriter writer)
        {
            Button button = this.Control;

            writer.WriteBeginTag("button"); // <button 
            writer.WriteAttribute("value", "submit"); // <button value="submit" 
            writer.WriteAttribute("id", button.ClientID); // <button value="submit" id="btnButton"

            PostBackOptions myPostBackOptions = new PostBackOptions(button);
            //Add the Postback event
            if (button.Page.ClientScript.GetPostBackEventReference(myPostBackOptions).Length > 0)
            {
                //Turn on Validation if it needs to be on...
                if (button.CausesValidation)
                    myPostBackOptions.PerformValidation = true;

                //Need to replace double quotes with single quotes for javascript to work.
                writer.WriteAttribute("onclick", button.Page.ClientScript.GetPostBackEventReference(myPostBackOptions).Replace("\"", "'")); // <button value="submit" 

                //Register the Event
                button.Page.ClientScript.RegisterForEventValidation(myPostBackOptions);
            } // <button value="submit" id="btnButton" onclick="__doPostBack('btnButton','')"

            if (button.CssClass.Length > 0)
                writer.WriteAttribute("class", button.CssClass); // <button value="submit" id="btnButton" onclick="__doPostBack('btnButton','')" class="large-button"

            writer.Write(HtmlTextWriter.TagRightChar); // <button value="submit" id="btnButton" onclick="__doPostBack('btnButton','')" class="large-button">
            writer.WriteFullBeginTag("span");
            writer.Write(button.Text);
            writer.WriteEndTag("span"); // <button value="submit" id="btnButton" onclick="__doPostBack('btnButton','')" class="large-button"><span>testButton</span>
            writer.WriteEndTag("button"); // <button value="submit" id="btnButton" onclick="__doPostBack('btnButton','')" class="large-button"><span>testButton</span></button>
        }
开发者ID:JBeans99,项目名称:CSharp__.NET,代码行数:32,代码来源:ButtonAdapter.cs

示例5: WriteFooter

        public static void WriteFooter(HtmlTextWriter wrtr, Type type,
            bool autoDocVersion)
        {
            wrtr.WriteBeginTag("div");
              wrtr.WriteAttribute("id", "content");
              wrtr.Write(HtmlTextWriter.TagRightChar);
              wrtr.WriteLine();

              wrtr.WriteFullBeginTag("h2");
              wrtr.Write("&nbsp;");
              wrtr.WriteEndTag("h2");
              wrtr.WriteLine();

              if (autoDocVersion)
              {
            AssemblyName name1 = type.Assembly.GetName();
            wrtr.Write("{0} {1}.{2}.{3}&nbsp;&nbsp;&nbsp;", name1.Name,
              name1.Version.Major, name1.Version.Minor, name1.Version.Build);

            AssemblyName name2 = typeof(XmlRpcServerProtocol).Assembly.GetName();
            wrtr.Write("{0} {1}.{2}.{3}&nbsp;&nbsp;&nbsp;", name2.Name,
              name2.Version.Major, name2.Version.Minor, name2.Version.Build);

            wrtr.Write(".NET CLR {0}.{1}.{2}&nbsp;&nbsp;&nbsp;",
              Environment.Version.Major,Environment.Version.Minor,
              Environment.Version.Build);
              }
              wrtr.WriteEndTag("div");
              wrtr.WriteLine();
        }
开发者ID:jbrunken,项目名称:ActiveForumsTapatalkXmlRpc,代码行数:30,代码来源:XmlRpcDocWriter.cs

示例6: RenderEndTag

 protected override void RenderEndTag(HtmlTextWriter writer)
 {
     base.RenderEndTag(writer);
     writer.WriteFullBeginTag("span");
     writer.WriteEndTag("span");
     writer.WriteEndTag("span");
 }
开发者ID:sidneylimafilho,项目名称:InfoControl,代码行数:7,代码来源:ButtonAdapter.cs

示例7: WriteTextInTag

		private static void WriteTextInTag(HtmlTextWriter writer, string tagName, string format, params string[] args)
		{
			string text = string.Format(format, args);

			writer.WriteFullBeginTag(tagName);
			writer.WriteEncodedText(text);
			writer.WriteEndTag(tagName);
		}
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:8,代码来源:WfHtmlSimulationWriter.cs

示例8: WriteHead

 public static void WriteHead(HtmlTextWriter wrtr, string title)
 {
   wrtr.WriteFullBeginTag("head");
   wrtr.WriteLine();
   WriteStyle(wrtr);
   WriteTitle(wrtr, title);
   wrtr.WriteEndTag("head");
 }
开发者ID:wbrussell,项目名称:xmlrpcnet,代码行数:8,代码来源:XmlRpcDocWriter.cs

示例9: Render

        protected override void Render(HtmlTextWriter writer)
        {
            writer.WriteFullBeginTag("h3");

            writer.WriteBeginTag("a");
            writer.AddAttribute("href", "#");
            writer.Write(HtmlTextWriter.TagRightChar);
            writer.Write(Title);
            writer.WriteEndTag("a");

            writer.WriteEndTag("h3");

            // Panel content wrapper div
            writer.WriteFullBeginTag("div");

            base.Render(writer);

            writer.WriteEndTag("div");
        }
开发者ID:ModeenF,项目名称:juiceui,代码行数:19,代码来源:AccordionPanel.cs

示例10: Render

		protected override void Render(HtmlTextWriter writer)
		{
			writer.WriteFullBeginTag("br");
			writer.WriteFullBeginTag("u");
			writer.WriteFullBeginTag("b");
			if (mDescription != "") 
				writer.Write(mDescription);
			else if (this.ID !=null)
				writer.Write(this.ID.ToString());
			else
				writer.Write("GHTSubTest.ID not set. Can not display the sub test id");
			writer.WriteEndTag("b");
			writer.WriteEndTag("u");

			base.Render (writer);
			Literal lbl = new Literal();
			lbl.Text=this.ID;
			this.Controls.Add (lbl);
		}
开发者ID:nobled,项目名称:mono,代码行数:19,代码来源:GHTSubTest.cs

示例11: RenderChildren

        protected override void RenderChildren(HtmlTextWriter writer)
        {
            try
            {
                base.RenderChildren(writer);
            }
            catch (HttpException ex)
            {
                writer.WriteFullBeginTag("div");
                writer.WriteFullBeginTag("h1");
                writer.WriteEncodedText("Error: Control could not be loaded");
                writer.WriteEndTag("h1");

                writer.WriteFullBeginTag("p");
                writer.WriteEncodedText(ex.Message);
                writer.WriteEndTag("p");
                writer.WriteEndTag("div");
            }
        }
开发者ID:radulazariciu,项目名称:Internship,代码行数:19,代码来源:ControlWrapper.aspx.cs

示例12: WriteDoc

        public static void WriteDoc(HtmlTextWriter wrtr, Type type,
            bool autoDocVersion)
        {
            XmlRpcServiceInfo svcInfo = XmlRpcServiceInfo.CreateServiceInfo(type);

              wrtr.WriteFullBeginTag("html");
              wrtr.WriteLine();
              WriteHead(wrtr, svcInfo.Name);
              wrtr.WriteLine();
              WriteBody(wrtr, type, autoDocVersion);
              wrtr.WriteEndTag("html");
        }
开发者ID:jbrunken,项目名称:ActiveForumsTapatalkXmlRpc,代码行数:12,代码来源:XmlRpcDocWriter.cs

示例13: RenderEndTag

        protected override void RenderEndTag(HtmlTextWriter writer)
        {
            if (Control.Enabled)
            {
                base.RenderEndTag(writer);

                if ((Control as TextBox).TextMode != TextBoxMode.MultiLine)
                {
                    writer.WriteFullBeginTag("span");
                    writer.WriteEndTag("span");
                }
                writer.WriteEndTag("span");
            }
        }
开发者ID:sidneylimafilho,项目名称:InfoControl,代码行数:14,代码来源:TextBoxAdapter.cs

示例14: WriteBody

        public static void WriteBody(HtmlTextWriter wrtr, Type type,
            bool autoDocVersion)
        {
            wrtr.WriteFullBeginTag("body");
              wrtr.WriteLine();

              WriteType(wrtr, type);
              wrtr.WriteLine();

              WriteFooter(wrtr, type, autoDocVersion);

              wrtr.WriteEndTag("div");
              wrtr.WriteLine();
              wrtr.WriteEndTag("body");
              wrtr.WriteLine();
        }
开发者ID:jbrunken,项目名称:ActiveForumsTapatalkXmlRpc,代码行数:16,代码来源:XmlRpcDocWriter.cs

示例15: RenderContents

 protected override void RenderContents(HtmlTextWriter output)
 {
     output.WriteFullBeginTag("span");
     output.WriteBeginTag("img");
     output.WriteAttribute("src", WebResource("DemoControl.images.down.jpg"));
     output.WriteAttribute("onclick", "toggle(this,'toggle_" + ClientID + "')");
     output.Write("/>");
     output.Write("&nbsp;" + Title);
     output.WriteEndTag("span");
     output.Write("<br />");
     output.WriteBeginTag("span");
     output.WriteAttribute("id", "toggle_" + ClientID);
     output.WriteAttribute("style", "display:none");
     output.Write(">" + Text);
     output.WriteEndTag("span");
 }
开发者ID:cstruter,项目名称:ASPNetWebResourcesDemo,代码行数:16,代码来源:CollapsePanel.cs


注:本文中的System.Web.UI.HtmlTextWriter.WriteFullBeginTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。