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


C# HtmlTextWriter.RenderBeginTag方法代码示例

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


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

示例1: Main

        static void Main(string[] args)
        {
            if (args.Length < 3)
            {
                Console.WriteLine("GEBRUIK: BarcodeGenerator <aantal Klein> <aantal Groot> <outputbestand>");
            }

            int kleinAmount = int.Parse(args[0]);
            int grootAmount = int.Parse(args[1]);
            string outfile = args[2];

            TextWriter writer = new StreamWriter(outfile);

            HtmlTextWriter html = new HtmlTextWriter(writer);

            html.RenderBeginTag(HtmlTextWriterTag.Html);
                html.RenderBeginTag(HtmlTextWriterTag.Head);
                    html.RenderBeginTag(HtmlTextWriterTag.Title);
                        html.Write("JOTARI QR-codes");
                    html.RenderEndTag();
                html.RenderEndTag();
                html.AddStyleAttribute(HtmlTextWriterStyle.FontFamily, "Arial");
                html.AddStyleAttribute(HtmlTextWriterStyle.FontSize, "20");
                html.Write(html.NewLine);
                html.RenderBeginTag(HtmlTextWriterTag.Body);
                    //html.RenderBeginTag(HtmlTextWriterTag.Table);
                        WriteQrCodes(html, kleinAmount, grootAmount, 3);
                    //html.RenderEndTag();
                html.RenderEndTag();
            html.RenderEndTag();

            writer.Close();
        }
开发者ID:LoyVanBeek,项目名称:Jotari_QRCode_Schedule,代码行数:33,代码来源:Program.cs

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

示例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)
        {
            if (this.GlyphiconType != GlyphiconTypes.None)
            {
                //<div class="input-group">
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "input-group");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                //  <span class="input-group-addon glyphicon glyphicon-lock"></span>
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "input-group-addon");
                writer.RenderBeginTag(HtmlTextWriterTag.Span);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, string.Format("glyphicon {0}", Glyphicon.GetGlyphiconCss(this.GlyphiconType)));
                writer.RenderBeginTag(HtmlTextWriterTag.Span);
                //writer.RenderBeginTag(HtmlTextWriterTag.I);
                writer.RenderEndTag();
                writer.RenderEndTag();
            }

            base.Render(writer);

            if (this.GlyphiconType != GlyphiconTypes.None)
            {
                //</div>
                writer.RenderEndTag();
            }
        }
开发者ID:fabriciogs,项目名称:Bootstrap.WebForms.Controls,代码行数:26,代码来源:TextBox.cs

示例5: GetDesignTimeHtml

        /// <summary>
        /// The design time generated HTML for the control.
        /// </summary>
        /// <returns>A string containing the HTML rendering.</returns>
        public override string GetDesignTimeHtml()
        {
            // Extremely simple design time rendering!
            // will work on something better sooner or later.
            // This acts as a placeholder.
            Web.PlotSurface2D plot = (Web.PlotSurface2D)Component;

            int xs = Convert.ToInt32(plot.Width.Value);
            if ( xs < 1 ) return "";
            int ys = Convert.ToInt32(plot.Height.Value);
            if ( ys < 1 ) return "";

            StringWriter sw = new StringWriter();
            HtmlTextWriter output= new HtmlTextWriter(sw);
            output.AddAttribute("border",plot.BorderWidth.ToString());
            output.AddAttribute("borderColor",plot.BorderColor.ToKnownColor().ToString());
            output.AddAttribute("cellSpacing","0");
            output.AddAttribute("cellPadding","0");
            output.AddAttribute("width",xs.ToString());
            output.RenderBeginTag("table ");
            output.RenderBeginTag("tr");
            output.AddAttribute("vAlign","center");
            output.AddAttribute("align","middle");
            output.AddAttribute("height",ys.ToString());
            output.RenderBeginTag("td");
            output.RenderBeginTag("P");
            output.Write("PlotSurface2D:" + plot.Title);
            output.RenderEndTag();
            output.RenderEndTag();
            output.RenderEndTag();
            output.RenderEndTag();
            output.Flush();

            return sw.ToString();
        }
开发者ID:JesusFreke,项目名称:didjimp,代码行数:39,代码来源:Web.Design.PlotSurface2D.cs

示例6: TestListSection

        public TestListSection(List<NunitGoTest> tests, string height = "90%")
        {
            var tree = new Tree(tests);
            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", Output.Files.FullReportFile).ButtonHtml);
                writer.RenderEndTag(); //DIV

                writer.AddStyleAttribute(HtmlTextWriterStyle.Margin, "5%");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.Write(tree.HtmlCode);
                writer.RenderEndTag(); //DIV
                
                writer.RenderEndTag(); //DIV

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

示例7: WithBody

        public EmailBuilder WithBody(IEnumerable<KeyValuePair<string, IList>> lists)
        {
            var writer = new StringWriter();
            var html = new HtmlTextWriter(writer);

            html.RenderBeginTag(HtmlTextWriterTag.H1);
            html.WriteEncodedText(_viewModel.Subject);
            html.RenderEndTag();
            html.WriteBreak();
            html.WriteBreak();
            foreach (var list in lists)
            {
                html.RenderBeginTag(HtmlTextWriterTag.H3);
                html.WriteEncodedText(list.Key);
                html.RenderEndTag();
                html.RenderBeginTag(HtmlTextWriterTag.Ul);
                foreach (var item in list.Value)
                {
                    html.RenderBeginTag(HtmlTextWriterTag.Li);
                    html.WriteEncodedText(item.ToString());
                    html.RenderEndTag();
                }
                html.RenderEndTag();
                html.WriteBreak();
                html.WriteBreak();
            }

            _viewModel.Body = writer.ToString();

            return this;
        }
开发者ID:COTB,项目名称:k94warriors,代码行数:31,代码来源:EmailBuilder.cs

示例8: RenderBeginTag

        protected override void RenderBeginTag(HtmlTextWriter writer)
        {
            // Div
            writer.AddAttribute(HtmlTextWriterAttribute.Class, WRAPPER_CSS_CLASS);
            writer.AddAttribute(HtmlTextWriterAttribute.Id, this.Control.ClientID);
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            writer.Indent++;

            // Ul
            string cssClass = "";
            if (!string.IsNullOrEmpty(this.Control.CssClass))
            {
                cssClass = this.Control.CssClass;
            }

            CheckBoxList checkList = this.Control as CheckBoxList;
            if (checkList != null)
            {
                cssClass += " " + REPEATDIRECTION_CSS_CLASS + checkList.RepeatDirection.ToString();
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, cssClass.Trim());

            writer.RenderBeginTag(HtmlTextWriterTag.Ul);
        }
开发者ID:thaond,项目名称:vdms-sym-project,代码行数:25,代码来源:CheckBoxListAdapter.cs

示例9: RenderContents

        protected override void RenderContents(HtmlTextWriter writer)
        {
            if (this.DesignMode) return;

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "sn-toolbar");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "sn-toolbar-inner");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            this.RenderUploadButton(writer);
            if (AllowOtherContentType) 
                RenderContentTypeDropDown(writer);
            this.RenderCancelButton(writer);

            writer.RenderEndTag();
            writer.RenderEndTag();

            this.RenderProgressBar(writer);

            if (!this._isEmpty) return;
            this.RenderEmptyEntry(writer);
            this.RenderFileInfo(writer);

            //StringBuilder sb = new StringBuilder();
            //sb.Append("var sm = sn.ux.smartMenu;");
            //sb.Append("$('.sn-toolbar-button').hover(sm.showArrow, sm.hideArrow);");
            //Page.ClientScript.RegisterStartupScript(typeof(Page), "empty7", sb.ToString(), true);
        }
开发者ID:maxpavlov,项目名称:FlexNet,代码行数:29,代码来源:ListViewUpload.cs

示例10: RenderTitleBar

 protected virtual void RenderTitleBar(HtmlTextWriter writer, WebPart webPart)
 {
     writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0");
     writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "0");
     writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
     writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
     writer.RenderBeginTag(HtmlTextWriterTag.Table);
     writer.RenderBeginTag(HtmlTextWriterTag.Tr);
     base.Zone.PartTitleStyle.AddAttributesToRender(writer, base.Zone);
     writer.RenderBeginTag(HtmlTextWriterTag.Td);
     writer.AddAttribute(HtmlTextWriterAttribute.Title, webPart.Description, true);
     writer.RenderBeginTag(HtmlTextWriterTag.Span);
     writer.WriteEncodedText(webPart.Title);
     writer.RenderEndTag();
     writer.RenderEndTag();
     base.Zone.PartTitleStyle.AddAttributesToRender(writer, base.Zone);
     writer.AddStyleAttribute(HtmlTextWriterStyle.TextAlign, TextAlign.Right.ToString());
     writer.RenderBeginTag(HtmlTextWriterTag.Td);
     if (base.WebPartManager.DisplayMode == WebPartManager.EditDisplayMode)
     {
         this.RenderVerbs(writer, webPart);
     }
     writer.RenderEndTag();
     writer.RenderEndTag();
     writer.RenderEndTag();
 }
开发者ID:t1b1c,项目名称:lwas,代码行数:26,代码来源:BaseChrome.cs

示例11: RenderTree

        public static IHtmlString RenderTree(this HtmlHelper helper, TopicTree tree)
        {
            var writer = new HtmlTextWriter(new StringWriter());

            writer.RenderBeginTag(HtmlTextWriterTag.Ul);
            foreach (var section in tree.Sections)
            {
                writer.RenderBeginTag(HtmlTextWriterTag.Li);
                writer.Write(section.Name);
                if (section.Topics.Count > 0)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Ul);
                    foreach (var topic in section.Topics)
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Li);
                        WriteLink(writer, topic);
                        writer.RenderEndTag();
                    }
                    writer.RenderEndTag();
                }
                writer.RenderEndTag();
            }
            writer.RenderEndTag();

            return MvcHtmlString.Create(writer.InnerWriter.ToString());
        }
开发者ID:CharliePoole,项目名称:website,代码行数:26,代码来源:TopicHelper.cs

示例12: 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.Cellspacing, "0");
     writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "0");
     writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
     writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
     if (webPart.Hidden && !base.WebPartManager.DisplayMode.ShowHiddenWebParts)
     {
         writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none");
     }
     writer.RenderBeginTag(HtmlTextWriterTag.Table);
     writer.RenderBeginTag(HtmlTextWriterTag.Tr);
     writer.RenderBeginTag(HtmlTextWriterTag.Td);
     if (base.WebPartManager.DisplayMode == WebPartManager.EditDisplayMode || webPart.ChromeType != PartChromeType.None)
     {
         this.RenderTitleBar(writer, webPart);
     }
     writer.RenderEndTag();
     writer.RenderEndTag();
     writer.RenderBeginTag(HtmlTextWriterTag.Tr);
     base.Zone.PartStyle.AddAttributesToRender(writer, base.Zone);
     writer.AddStyleAttribute(HtmlTextWriterStyle.Padding, base.Zone.PartChromePadding.ToString());
     writer.RenderBeginTag(HtmlTextWriterTag.Td);
     this.RenderPartContents(writer, webPart);
     writer.RenderEndTag();
     writer.RenderEndTag();
     writer.RenderEndTag();
 }
开发者ID:t1b1c,项目名称:lwas,代码行数:33,代码来源:BaseChrome.cs

示例13: RenderHtml

        private static void RenderHtml(IEnumerable<Question> listOfQuestions)
        {
            using (var streamWriter = new StreamWriter(HtmlFilePath))
            {
                using (var htmlWriter = new HtmlTextWriter(streamWriter))
                {
                    htmlWriter.RenderBeginTag(HtmlTextWriterTag.Html);
                    htmlWriter.RenderBeginTag(HtmlTextWriterTag.Head);
                    htmlWriter.RenderBeginTag(HtmlTextWriterTag.Title);
                    htmlWriter.Write("Telerik Q&A Forum");
                    htmlWriter.RenderEndTag();
                    htmlWriter.RenderEndTag();
                    htmlWriter.RenderBeginTag(HtmlTextWriterTag.Body);
                    htmlWriter.RenderBeginTag(HtmlTextWriterTag.Ul);

                    foreach (var question in listOfQuestions)
                    {
                        RenderQuestion(htmlWriter, question);
                    }

                    htmlWriter.RenderEndTag();
                    htmlWriter.RenderEndTag();
                    htmlWriter.RenderEndTag();
                }
            }
        }
开发者ID:hrist0stoichev,项目名称:Telerik-Homeworks,代码行数:26,代码来源:ParseQaRSSFeed.cs

示例14: GenerateGeneralPage

        private static void GenerateGeneralPage(string inputFilePath, string outputFilePath, Dictionary<PackageKey, FeedPackage> feedPackages)
        {
            using (var stringWriter = new StringWriter())
            {
                using (var writer = new HtmlTextWriter(stringWriter))
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.H1);
                    {
                        writer.WriteLine("Nuget Package Report Overview");
                    }
                    writer.RenderEndTag();

                    writer.WriteGeneralInformation(inputFilePath, feedPackages);
                    writer.WriteBreak();

                    writer.RenderBeginTag(HtmlTextWriterTag.Table);
                    {
                        WriteGeneralPageTableHeaders(writer, "Package Name", "Current Version", "Latest Version", "License",
                                                     "Instances");

                        foreach (var package in feedPackages)
                        {
                            WriteGeneralPagePackageRows(writer, package);
                        }
                    }
                    writer.RenderEndTag();

                    var content = writer.InnerWriter.ToString();

                    var path = Path.Combine(outputFilePath, GeneralPageFileName);
                    File.WriteAllText(path, content);
                    System.Diagnostics.Process.Start(path);
                }
            }
        }
开发者ID:Banane9,项目名称:NugetPackageReport,代码行数:35,代码来源:ReportWriter.cs

示例15: RenderContents

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

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

            writer.AddAttribute("class", "ww-code");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            writer.WriteEncodedText(this.CorrelatesWith ?? string.Empty);
            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,代码行数:25,代码来源:CorrelationScopeView.cs


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