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


C# HtmlTextWriter.Write方法代码示例

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


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

示例1: Render

        protected override void Render(HtmlTextWriter writer)
        {
            base.Render(writer);

            // allow third party applications to override the title of the current node in the breadcrumb
            SPCLF3.Master_Pages.CLF3PublishingMaster masterPage = (SPCLF3.Master_Pages.CLF3PublishingMaster)this.Page.Master;
            if (String.IsNullOrEmpty(masterPage.PageTitle))
            {
                if (SPContext.Current.ListItem != null && PublishingPage.IsPublishingPage(SPContext.Current.ListItem))
                {
                    PublishingPage publishingPage = PublishingPage.GetPublishingPage(SPContext.Current.ListItem);
                    writer.WriteLine(publishingPage.Title);
                }
                else if(SPContext.Current.ListItem != null)
                {
                    writer.Write(SPContext.Current.ListItem.Title);
                }
                else if (SPContext.Current.List != null)
                {
                    writer.Write(SPContext.Current.List.Title);
                }
            }
            else
                writer.WriteLine(masterPage.PageTitle);
        }
开发者ID:ckeays,项目名称:wet-boew-sharepoint,代码行数:25,代码来源:PageTitle.cs

示例2: RenderControl

        /// <summary>
        /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param>
        public override void RenderControl( HtmlTextWriter writer )
        {
            if ( this.Visible )
            {
                string alertType = NotificationBoxType.ToString().ToLower();

                bool showMessage = !string.IsNullOrWhiteSpace( Heading ) || !string.IsNullOrWhiteSpace( Title ) || !string.IsNullOrWhiteSpace( this.Text );

                if ( showMessage )
                {
                    writer.AddAttribute( "class", "alert alert-" + alertType );
                    writer.RenderBeginTag( HtmlTextWriterTag.Div );

                    if ( !string.IsNullOrWhiteSpace( Heading ) )
                    {
                        writer.RenderBeginTag( HtmlTextWriterTag.H4 );
                        writer.Write( Heading );
                        writer.RenderEndTag();
                    }

                    if ( !string.IsNullOrWhiteSpace( Title ) )
                    {
                        writer.RenderBeginTag( HtmlTextWriterTag.Strong );
                        writer.Write( Title + " ");
                        writer.RenderEndTag();
                    }

                    base.RenderControl( writer );

                    writer.RenderEndTag();
                }
            }
        }
开发者ID:pkdevbox,项目名称:Rock,代码行数:37,代码来源:NotificationBox.cs

示例3: AccordionHtml

 /// <summary>
 /// Accordions the HTML.
 /// </summary>
 /// <param name="html">The HTML.</param>
 /// <param name="items">The items.</param>
 /// <param name="headertemplete">The headertemplete.</param>
 /// <param name="itemtemplete">The itemtemplete.</param>
 public static void AccordionHtml(this HtmlHelper html, List<AccordionItem> items, Func<AccordionItem, string> headertemplete, Func<AccordionLeafItem, string> itemtemplete)
 {
     if (items != null)
     {
         StringBuilder buffer = new StringBuilder();
         HtmlTextWriter writer = new HtmlTextWriter(new StringWriter(buffer));
         foreach (AccordionItem item in items)
         {
             writer.AddAttribute(HtmlTextWriterAttribute.Class, "accordionheadercontainer");
             writer.RenderBeginTag(HtmlTextWriterTag.Div);
             writer.Write(headertemplete(item));
             writer.RenderEndTag();
             writer.AddAttribute(HtmlTextWriterAttribute.Class, "accordionbody");
             writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none");
             writer.RenderBeginTag(HtmlTextWriterTag.Div);
             writer.RenderBeginTag(HtmlTextWriterTag.Ul);
             foreach (AccordionLeafItem leafitem in item.Children)
             {
                 writer.AddAttribute(HtmlTextWriterAttribute.Class, "accordionitemcontainer");
                 writer.RenderBeginTag(HtmlTextWriterTag.Li);
                 writer.Write(itemtemplete(leafitem));
                 writer.RenderEndTag();
             }
             writer.RenderEndTag();
             writer.RenderEndTag();
         }
         HttpContext.Current.Response.Write(buffer.ToString());
     }
 }
开发者ID:xiachanghao,项目名称:SmartBoxConsole,代码行数:36,代码来源:HtmlHelperExtension.cs

示例4: Render

		protected override void Render( HtmlTextWriter writer )
		{
			if( this.returnCode == ASTreeViewAjaxReturnCode.OK )
				writer.Write( ( (int)this.returnCode ).ToString() + "|" + this.cusReturnCode + "|" + this.cusMessage );
			else
				writer.Write( this.errorMessage );
		}
开发者ID:jinweijie,项目名称:Goldtect.ASTreeViewSamples,代码行数:7,代码来源:ASTreeViewDeleteNodeProviderLimit.aspx.cs

示例5: RenderContents

 protected override void RenderContents(HtmlTextWriter writer)
 {
     writer.Write("<tbody>");
     RenderHeader(writer);
     base.RenderContents(writer);
     writer.Write("</tbody>");
 }
开发者ID:burstinair,项目名称:burst.net,代码行数:7,代码来源:Table.cs

示例6: RenderContents

		protected override void RenderContents(HtmlTextWriter writer)
		{
            bool beginTagWritten = false;
            foreach (var field in this.ContentView.Content.Fields.Values)
            {
                if (field.ValidationResult == null)
                    continue;
                if (this.ContentView.NeedToValidate && !field.ReadOnly && !field.IsValid)
                {
                    if (!beginTagWritten)
                    {
                        writer.AddAttribute(HtmlTextWriterAttribute.Class, "sn-error-msg");
                        writer.RenderBeginTag(HtmlTextWriterTag.Div);
                        beginTagWritten = true;
                    }
                    writer.Write(field.DisplayName);
                    writer.Write(": ");
                    writer.Write(ResolveValidationResult(field));
                    writer.WriteBreak();
                }
            }
            if (beginTagWritten)
                writer.RenderEndTag();
            if (this.ContentView.ContentException != null)
                RenderContentError(writer, this.ContentView.ContentException, this.Debug);
		}
开发者ID:maxpavlov,项目名称:FlexNet,代码行数:26,代码来源:ErrorView.cs

示例7: Render

 protected override void Render(HtmlTextWriter writer)
 {
     if (string.IsNullOrEmpty(Size))
         writer.Write(IconHelper.RenderIconTag(Icon, Overlay));
     else
         writer.Write(IconHelper.RenderIconTag(Icon, Overlay, Int32.Parse(Size)));
 }
开发者ID:maxpavlov,项目名称:FlexNet,代码行数:7,代码来源:SNIcon.cs

示例8: 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

示例9: Render

 protected override void Render(HtmlTextWriter writer)
 {
     writer.Write("<div style=\"display:none;\">");
     writer.Write("<div id=\"" + this.ClientID + "\">");
     base.RenderContents(writer);
     writer.Write("</div></div>");
 }
开发者ID:ender2021,项目名称:jQuery-ASP.NET-Control-Library,代码行数:7,代码来源:jFancyBoxContent.cs

示例10: Render

        protected override void Render(HtmlTextWriter writer)
        {
            if (HttpContext.Current == null)
            {
                writer.Write("[" + this.ID + "]");
                return;
            }

            if (fileName.Length == 0) { return; }

            if (sizes.Length > 0)
            {
                writer.Write("\n<link rel='apple-touch-icon' sizes=\"{0}\" href='{1}{2}' />",
                   sizes,
                  SiteUtils.DetermineSkinBaseUrl(true, false, Page),
                  fileName
                  );
            }
            else
            {
                writer.Write("\n<link rel='apple-touch-icon' href='{0}{1}' />",
                   SiteUtils.DetermineSkinBaseUrl(true, false, Page),
                   fileName
                   );

            }
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:27,代码来源:AppleTouchIcon.cs

示例11: RenderHeader

        public override void RenderHeader(HtmlTextWriter writer)
        {
            string spacer = "<img src='" + Page.ResolveClientUrl(Panel.ImagesDir + "spacer.gif") + "'/>";

            writer.WriteLine("");
            writer.Write("<table cellpadding='" + CellPadding + "' cellspacing='" + CellSpacing + "'");
            StringBuilder style = new StringBuilder();
            if (!Width.IsEmpty)
            {
                style.Append("width:" + Width + ";");
            }
            if (style.Length > 0)
            {
                writer.Write(" style='" + style + "'");
            }
            writer.WriteLine(">");
            writer.WriteLine("	<tr>");
            writer.WriteLine("		<td class='panel_grey_ul'>" + spacer + "</td>");
            writer.WriteLine("		<td class='panel_grey_u'>" + spacer + "</td>");
            writer.WriteLine("		<td class='panel_grey_ur'>" + spacer + "</td>");
            writer.WriteLine("	</tr>");
            writer.WriteLine("	<tr>");
            writer.WriteLine("		<td class='panel_grey_l'>" + spacer + "</td>");
            writer.WriteLine("		<td class='panel_grey_c' align='" + InnerAlign + "'>");
        }
开发者ID:3agrey,项目名称:pbc,代码行数:25,代码来源:PanelGrey.cs

示例12: RenderContents

        protected override void RenderContents(HtmlTextWriter writer)
        {
            writer.AddAttribute("class", "header");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.RenderBeginTag(HtmlTextWriterTag.Label);
            writer.Write("Foreach");
            writer.RenderEndTag();

            writer.AddAttribute("class", "ww-code");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            writer.WriteEncodedText(this.Argument);
            writer.RenderEndTag();

            writer.RenderBeginTag(HtmlTextWriterTag.Label);
            writer.Write("in");
            writer.RenderEndTag();

            writer.AddAttribute("class", "ww-code");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            writer.WriteEncodedText(this.Values);
            writer.RenderEndTag();

            writer.RenderEndTag();

            writer.RenderBeginTag(HtmlTextWriterTag.Label);
            writer.Write("Body");
            writer.RenderEndTag();

            writer.AddAttribute("class", "body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            this.Body.Render(writer);
            writer.RenderEndTag();
        }
开发者ID:jmangelo,项目名称:Inthros,代码行数:34,代码来源:ForEachView.cs

示例13: WriteMenu

 protected void WriteMenu( HtmlTextWriter writer )
 {
     writer.WriteLine("<div style='text-align: right'>");
     writer.Write("<a href='{0}topalliances.aspx?option=round'>{1}</a> | ", OrionGlobals.AppPath, CultureModule.getContent("alliance_by_round"));
     writer.Write("<a href='{0}topalliances.aspx?option=rank'>{1}</a>", OrionGlobals.AppPath, CultureModule.getContent("alliance_by_rank"));
     writer.WriteLine("</div><p/>");
 }
开发者ID:zi-yu,项目名称:orionsbelt,代码行数:7,代码来源:TopAlliances.cs

示例14: RenderBeginTag

        protected override void RenderBeginTag(HtmlTextWriter writer)
        {
            if (Extender.AdapterEnabled)
            {
                Extender.RenderBeginTag(writer, "art-vmenublock");

                writer.Write("<div class=\"art-vmenublock-tl\"></div>");
                writer.Write("<div class=\"art-vmenublock-tr\"></div>");
                writer.Write("<div class=\"art-vmenublock-bl\"></div>");
                writer.Write("<div class=\"art-vmenublock-br\"></div>");
                writer.Write("<div class=\"art-vmenublock-tc\"></div>");
                writer.Write("<div class=\"art-vmenublock-bc\"></div>");
                writer.Write("<div class=\"art-vmenublock-cl\"></div>");
                writer.Write("<div class=\"art-vmenublock-cr\"></div>");
                writer.Write("<div class=\"art-vmenublock-cc\"></div>");

                writer.Write("<div class=\"art-vmenublock-body\">");
                writer.Write("<div class=\"art-vmenublockcontent\">");
                writer.Write("<div class=\"art-vmenublockcontent-body\">");
            }
            else
            {
                base.RenderBeginTag(writer);
            }
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:25,代码来源:MenuAdapterArtisteerVertical.cs

示例15: RenderContents

        protected override void RenderContents(HtmlTextWriter output)
        {
            output.AddAttribute(HtmlTextWriterAttribute.Type, "text/javascript");
            output.RenderBeginTag(HtmlTextWriterTag.Script);

            foreach (var script in Scripts.Where(r => !r.Item2))
            {
                output.Write(script.Item1);
            }

            var inlineScripts = Scripts.Where(r => r.Item2).Select(r => r.Item1).Distinct().ToList();

            if (inlineScripts.Any())
            {
                output.Write("jq(document).ready(function(){");

                foreach (var script in inlineScripts)
                {
                    output.Write(script);
                }

                output.Write("});");
            }

            output.RenderEndTag();
        }
开发者ID:haoasqui,项目名称:ONLYOFFICE-Server,代码行数:26,代码来源:InlineScript.cs


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