本文整理汇总了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();
}
示例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());
}
}
示例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();
}
}
}
示例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();
}
}
示例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();
}
示例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();
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}
示例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());
}
示例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();
}
示例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();
}
}
}
示例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);
}
}
}
示例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();
}