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


C# HtmlTextWriter.RenderEndTag方法代码示例

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


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

示例1: RadioButton

        /// <summary>
        /// Renders the RadioButton
        /// </summary>
        /// <param name="helper">The helper.</param>
        /// <param name="displayText">The display text.</param>
        /// <param name="radioButtonName">Name of the radio button.</param>
        /// <param name="radioButtonValue">The radio button value.</param>
        /// <param name="radioButtonId">The radio button id.</param>
        /// <param name="radioButtonIsChecked">if set to <c>true</c> [radio button is checked].</param>
        /// <param name="radioButtonHtmlAttributes">The radio button HTML attributes.</param>
        /// <returns></returns>
        public static string RadioButton(this HtmlHelper helper, string displayText, string radioButtonName, object radioButtonValue, string radioButtonId, bool radioButtonIsChecked, IDictionary<string, object> radioButtonHtmlAttributes)
        {
            var writer = new HtmlTextWriter(new StringWriter());

            writer.AddAttribute("for", radioButtonId);
            writer.RenderBeginTag(HtmlTextWriterTag.Label);

            writer.AddAttribute("type", "radio");
            writer.AddAttribute("id", radioButtonId);
            writer.AddAttribute("name", radioButtonName);
            writer.AddAttribute("value", radioButtonValue.ToString());

            if (radioButtonIsChecked)
            {
                writer.AddAttribute("checked", "checked");
            }

            foreach (var pair in radioButtonHtmlAttributes)
            {
                writer.AddAttribute(pair.Key, pair.Value.ToString());
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Input);

            writer.RenderEndTag();

            writer.WriteEncodedText(displayText);

            writer.RenderEndTag();

            return writer.InnerWriter.ToString();
        }
开发者ID:bothaj,项目名称:JBSoft,代码行数:42,代码来源:RadioButtonHelper.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: WriteSkipLinkStart

 internal static void WriteSkipLinkStart(HtmlTextWriter writer, Version renderingCompatibility, bool designMode, string skipLinkText, string spacerImageUrl, string clientID) {
     if (skipLinkText.Length != 0 && !designMode) {
         if (renderingCompatibility >= VersionUtil.Framework45) {
             writer.AddAttribute(HtmlTextWriterAttribute.Href, '#' + clientID + SkipLinkContentMark);
             writer.AddStyleAttribute(HtmlTextWriterStyle.Position, "absolute");
             writer.AddStyleAttribute(HtmlTextWriterStyle.Left, "-10000px");
             writer.AddStyleAttribute(HtmlTextWriterStyle.Top, "auto");
             writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "1px");
             writer.AddStyleAttribute(HtmlTextWriterStyle.Height, "1px");
             writer.AddStyleAttribute(HtmlTextWriterStyle.Overflow, "hidden");
             writer.RenderBeginTag(HtmlTextWriterTag.A);
             writer.Write(skipLinkText);
             writer.RenderEndTag();
         }
         else {
             writer.AddAttribute(HtmlTextWriterAttribute.Href, '#' + clientID + SkipLinkContentMark);
             writer.RenderBeginTag(HtmlTextWriterTag.A);
             writer.AddAttribute(HtmlTextWriterAttribute.Alt, skipLinkText);
             writer.AddAttribute(HtmlTextWriterAttribute.Src, spacerImageUrl);
             writer.AddStyleAttribute(HtmlTextWriterStyle.BorderWidth, "0px");
             writer.AddAttribute(HtmlTextWriterAttribute.Width, "0");
             writer.AddAttribute(HtmlTextWriterAttribute.Height, "0");
             writer.RenderBeginTag(HtmlTextWriterTag.Img);
             writer.RenderEndTag();
             writer.RenderEndTag();
         }
     }
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:28,代码来源:ControlRenderingHelper.cs

示例4: Render

        protected override void Render(HtmlTextWriter writer)
        {
            //// Определение атрибута, содержащего ссылку
            //writer.AddAttribute(HtmlTextWriterAttribute.Href, "http://example.com");
            //// Определение стиля атрибута (размер шрифат)
            //writer.AddStyleAttribute(HtmlTextWriterStyle.FontSize, "30");
            //// Открытие тега <a>
            //writer.RenderBeginTag(HtmlTextWriterTag.A);
            //// Вывод статического содержимого на страницу
            //writer.Write("Web Forms");
            //// Закрытие тега <a>
            //writer.RenderEndTag();

            Param1 = "Груша";
            Param2 = "Яблоко";
            Param3 = "Слива";

            writer.RenderBeginTag(HtmlTextWriterTag.Ol);
            writer.RenderBeginTag(HtmlTextWriterTag.Li);
            writer.Write(Param1);
            writer.RenderEndTag();
           

            
            writer.RenderBeginTag(HtmlTextWriterTag.Li);
            writer.Write(Param2);
            writer.RenderEndTag();
            

           
            writer.RenderBeginTag(HtmlTextWriterTag.Li);
            writer.Write(Param3);
            writer.RenderEndTag();
            writer.RenderEndTag();
        } 
开发者ID:elfas89,项目名称:ASP.NET_Lesson4,代码行数:35,代码来源:MyControl.cs

示例5: Build

		/// <summary>
		/// 获取表单字段的html
		/// </summary>
		public string Build(FormField field, Dictionary<string, string> htmlAttributes) {
			var provider = Application.Ioc.Resolve<FormHtmlProvider>();
			var attribute = (CaptchaFieldAttribute)field.Attribute;
			var html = new HtmlTextWriter(new StringWriter());
			// 控件组
			html.AddAttribute("class", "input-group");
			html.RenderBeginTag("div");
			// 输入框
			foreach (var pair in provider.FormControlAttributes) {
				html.AddAttribute(pair.Key, pair.Value);
			}
			html.AddAttribute("name", field.Attribute.Name);
			html.AddAttribute("value", (field.Value ?? "").ToString());
			html.AddAttribute("type", "text");
			html.AddAttribute("placeholder", new T(attribute.PlaceHolder));
			foreach (var pair in htmlAttributes) {
				html.AddAttribute(pair.Key, pair.Value);
			}
			html.RenderBeginTag("input");
			html.RenderEndTag();
			// 验证码图片
			html.AddAttribute("class", "input-group-addon");
			html.RenderBeginTag("span");
			html.AddAttribute("alt", new T("Captcha"));
			html.AddAttribute("class", "captcha");
			html.AddAttribute("src", "/captcha?key=" + attribute.Key);
			html.AddAttribute("title", new T("Click to change captcha image"));
			html.RenderBeginTag("img");
			html.RenderEndTag(); // img
			html.RenderEndTag(); // span
			html.RenderEndTag(); // div
			return provider.FormGroupHtml(
				field, htmlAttributes, html.InnerWriter.ToString());
		}
开发者ID:daywrite,项目名称:ZKWeb.Plugins,代码行数:37,代码来源:Captcha.cs

示例6: TestOutputSection

        public TestOutputSection(string testOutput, string backHref, string height = "90%")
        {
            var stringWriter = new StringWriter();
            using (var writer = new HtmlTextWriter(stringWriter))
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.Height, height);
                writer.AddStyleAttribute(HtmlTextWriterStyle.BackgroundColor, Colors.White);
                writer.AddStyleAttribute(HtmlTextWriterStyle.Overflow, "scroll");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                writer.AddStyleAttribute(HtmlTextWriterStyle.Margin, "1% 2% 3% 97%");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.Write(new CloseButton("Back", backHref).ButtonHtml);
                writer.RenderEndTag(); //DIV

                writer.AddStyleAttribute(HtmlTextWriterStyle.Margin, "5%");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "pre-line");
                writer.AddStyleAttribute(HtmlTextWriterStyle.BackgroundColor, Colors.White);
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.Write(testOutput);
                writer.RenderEndTag();//DIV
                writer.RenderEndTag(); //DIV
                
                writer.RenderEndTag(); //DIV

            }
            HtmlCode = stringWriter.ToString();
        }
开发者ID:TomDrJones,项目名称:NUnitGo,代码行数:29,代码来源:TestOutputSection.cs

示例7: RenderContents

 protected override void RenderContents(HtmlTextWriter output)
 {
     output.RenderBeginTag(HtmlTextWriterTag.Div);
     output.RenderBeginTag(HtmlTextWriterTag.Input);
     output.RenderEndTag();
     output.RenderEndTag();
 }
开发者ID:kacecode,项目名称:SchoolWork,代码行数:7,代码来源:Listing25-14.cs

示例8: Render

 //-------------------------------------------------------------------------------------------
 protected override void Render(HtmlTextWriter writer)
 {
     if (!Visible)
     {
         return;
     }
     writer.AddStyleAttribute(HtmlTextWriterStyle.BorderStyle,	BorderStyle.ToString());
     writer.AddStyleAttribute(HtmlTextWriterStyle.BorderWidth,	BorderWidth.ToString());
     writer.AddAttribute(HtmlTextWriterAttribute.Width,			Width.ToString());
     writer.AddAttribute(HtmlTextWriterAttribute.Href,			Height.ToString());
     writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding,	"0");
     writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing,	"0");
     writer.AddAttribute(HtmlTextWriterAttribute.Align,			"center");
     writer.RenderBeginTag("table");
         writer.AddAttribute(HtmlTextWriterAttribute.Class,	"groupboxtitle");
         writer.RenderBeginTag("tr");
             writer.AddAttribute(HtmlTextWriterAttribute.Background,	"images/group-box-bar.gif");
             writer.RenderBeginTag("td");
                 writer.Write(Text);
             writer.RenderEndTag();
         writer.RenderEndTag();
         for (int i = 0; i < Items.Count; i++)
         {
             RenderItemRow(writer, Items[i]);
         }
     writer.RenderEndTag();
 }
开发者ID:weavver,项目名称:net,代码行数:28,代码来源:WeavverGroupBox.cs

示例9: Render

        //***************************************************************************
        // Private Methods
        // 
        protected override void Render(HtmlTextWriter writer)
        {
            base.Render(writer);

            if (!this.CheckRender())
                return;

            writer.AddAttribute(HtmlTextWriterAttribute.Class, string.IsNullOrEmpty(this.CssClass)
                                                                ? "iconGroup"
                                                                : this.CssClass);
            writer.RenderBeginTag(HtmlTextWriterTag.Fieldset);

            writer.RenderBeginTag(HtmlTextWriterTag.Legend);
            writer.WriteEncodedText(this._menuItem.Text);
            writer.RenderEndTag(); // Legend

            foreach (Control c in this.Controls)
            {
                if (!(c is DynamicMenuChildControl))
                    continue;

                c.RenderControl(writer);
            }

            writer.RenderEndTag(); // Fieldset
        }
开发者ID:tenshino,项目名称:RainstormStudios,代码行数:29,代码来源:IconMenu.cs

示例10: Render

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

            Writer = writer;
            WriteTitle("FedAuth Cookie Information");

            if (false == present)
            {
                writer.Write("Cookie not present");
                return;
            }

            writer.RenderBeginTag(HtmlTextWriterTag.Dl);
            foreach (String key in rawValues.AllKeys)
                RenderListEntry(key, rawValues[key]);
            writer.RenderEndTag();

            writer.RenderBeginTag(HtmlTextWriterTag.Dl);
            RenderListEntry("Context", context);
            RenderListEntry("IsPersistent", isPersistent);
            RenderListEntry("IsSessionMode", isSessionMode);
            RenderListEntry("Id", id);
            RenderListEntry("ValidFrom", validFrom);
            RenderListEntry("ValidTo", validTo);
            writer.RenderEndTag();
        }
开发者ID:davidajulio,项目名称:claims,代码行数:27,代码来源:CookieInfo.cs

示例11: RenderScores

        private static void RenderScores(HtmlTextWriter htmlWriter, MatchHeaderInfo match, int player)
        {
            htmlWriter.AddAttribute(HtmlTextWriterAttribute.Class, "scores");
            htmlWriter.RenderBeginTag(HtmlTextWriterTag.Div);
            if (match.SetScores.IsNullOrEmpty() && (int)match.Status < (int)MatchStatus.Completed)
            {
                if (player == 0)
                {

                    htmlWriter.Write(match.Date);
                }
                else if (match.StartTime.HasValue)
                {
                    htmlWriter.Write(match.StartTime.Value.ToString("HH:mm"));
                }
            }
            else
            {
                foreach (var setScore in match.SetScores)
                {
                    
                    htmlWriter.RenderBeginTag(HtmlTextWriterTag.Span);
                    var points = (player == 0 ? setScore.Player1Points : setScore.Player2Points);
                    htmlWriter.Write(points == 0 ? " " : points.ToString());
                    htmlWriter.RenderEndTag();
                }
            }
            htmlWriter.RenderEndTag();
        }
开发者ID:shaimuli,项目名称:Simple.SAMS,代码行数:29,代码来源:TournamentBracketGenerator.cs

示例12: Render

        protected override void Render(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Id, string.Concat(ClientID, "-container"));
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "button");
            writer.RenderBeginTag(HtmlTextWriterTag.Span);

            if ( NavigateUrl == null )
            {
                AddAttributesToRender(writer);
            }
            else
            {
                string path = NavigateUrl;
                string qs = string.Empty;
                int splitIndex = path.IndexOf('?');

                if ( splitIndex != -1 )
                {
                    path = NavigateUrl.Substring(0, splitIndex);
                    qs = NavigateUrl.Substring(splitIndex);
                }

                path = VirtualPathUtility.ToAbsolute(path);
                writer.AddAttribute(HtmlTextWriterAttribute.Href, string.Concat(path, qs));
            }

            writer.RenderBeginTag(HtmlTextWriterTag.A);
            writer.WriteEncodedText(Text);
            writer.RenderEndTag();

            writer.RenderEndTag();
        }
开发者ID:andy-uq,项目名称:Echo,代码行数:32,代码来源:Button.cs

示例13: Render

		protected override void Render(HtmlTextWriter writer)
		{
			writer.AddAttribute(HtmlTextWriterAttribute.Class, "qsfSkinMgr");
			writer.RenderBeginTag(HtmlTextWriterTag.Div);

			writer.AddAttribute(HtmlTextWriterAttribute.Class, "qscLink");
			writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "javascript:openSkinChooser(event);");
			writer.RenderBeginTag(HtmlTextWriterTag.A);
			RenderTitle(writer);
			writer.RenderEndTag(); // qscLink

			writer.AddAttribute(HtmlTextWriterAttribute.Class, "qscAnimContainer");
			writer.RenderBeginTag(HtmlTextWriterTag.Div);

			writer.AddAttribute(HtmlTextWriterAttribute.Class, "qscDropDown");
			writer.RenderBeginTag(HtmlTextWriterTag.Div);

			RenderCorners(writer);

			RenderChooser(writer, GetSkinChooser());

			writer.RenderEndTag(); // qscDropDown
			writer.RenderEndTag(); // qscAnimationContainer
			writer.RenderEndTag(); // qsfSkinMgt
		}
开发者ID:Letractively,项目名称:henoch,代码行数:25,代码来源:Header.cs

示例14: RenderWebPart

 public override void RenderWebPart(HtmlTextWriter writer, WebPart webPart)
 {
     if (webPart == null)
     {
         throw new ArgumentNullException("webPart");
     }
     base.Zone.PartChromeStyle.AddAttributesToRender(writer, base.Zone);
     writer.AddAttribute(HtmlTextWriterAttribute.Class, "divzone_part_chrome");
     writer.RenderBeginTag(HtmlTextWriterTag.Div);
     if (base.WebPartManager.DisplayMode == WebPartManager.EditDisplayMode || webPart.ChromeType != PartChromeType.None || !webPart.Hidden)
     {
         this.RenderTitleBar(writer, webPart);
     }
     base.Zone.PartStyle.AddAttributesToRender(writer, base.Zone);
     if (webPart.Hidden && !base.WebPartManager.DisplayMode.ShowHiddenWebParts)
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Class, "divzone_part_hidden");
     }
     else
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Class, "divzone_part");
     }
     writer.RenderBeginTag(HtmlTextWriterTag.Div);
     this.RenderPartContents(writer, webPart);
     writer.RenderEndTag();
     writer.RenderEndTag();
 }
开发者ID:t1b1c,项目名称:lwas,代码行数:27,代码来源:DivChrome.cs

示例15: WriteButton

 private static void WriteButton(HtmlTextWriter writer, ToolBarButton button)
 {
     writer.AddAttribute(HtmlTextWriterAttribute.Class, "g_ToolbarButton");
     if(!string.IsNullOrEmpty(button.Id))
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Id, button.Id);
     }
     writer.RenderBeginTag(HtmlTextWriterTag.Span);
     writer.AddAttribute(HtmlTextWriterAttribute.Href, button.Url);
     if(!string.IsNullOrEmpty(button.Onclick))
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Onclick, button.Onclick);
     }
     writer.RenderBeginTag(HtmlTextWriterTag.A);
     if(!string.IsNullOrEmpty(button.Img))
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Src, button.Img);
         writer.AddAttribute(HtmlTextWriterAttribute.Alt, button.Alt);
         writer.RenderBeginTag(HtmlTextWriterTag.Img);
         writer.RenderEndTag();
     }
     writer.Write(button.Title);
     writer.RenderEndTag();
     writer.RenderEndTag();
 }
开发者ID:dmziryanov,项目名称:ApecAuto,代码行数:25,代码来源:Toolbar.cs


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