本文整理汇总了C#中System.Web.UI.HtmlTextWriter.EndRender方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTextWriter.EndRender方法的具体用法?C# HtmlTextWriter.EndRender怎么用?C# HtmlTextWriter.EndRender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.HtmlTextWriter
的用法示例。
在下文中一共展示了HtmlTextWriter.EndRender方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoRender
/// <summary>
///
/// </summary>
/// <param name="output"></param>
protected override void DoRender(HtmlTextWriter output)
{
LanguageCollection languageCollection = LanguageManager.GetLanguages(Sitecore.Context.Database);
output.BeginRender();
if (languageCollection.Any())
{
output.AddAttribute(HtmlTextWriterAttribute.Class, "pickLanguage");
output.RenderBeginTag(HtmlTextWriterTag.P);
foreach (Language language in languageCollection)
{
Sitecore.Data.ID contextLanguageId = LanguageManager.GetLanguageItemId(language, Sitecore.Context.Database);
Item contextLanguage = Sitecore.Context.Database.GetItem(contextLanguageId);
string iso = contextLanguage.Fields["Regional Iso Code"].Value;
if (string.IsNullOrEmpty(iso))
{
iso = contextLanguage["Iso"];
}
output.AddAttribute(HtmlTextWriterAttribute.Href, String.Format("?sc_lang={0}", iso));
output.RenderBeginTag(HtmlTextWriterTag.A);
output.WriteLine(FieldRenderer.Render(contextLanguage, "Display Image", "mw=20"));
output.RenderEndTag();
}
output.RenderEndTag();
}
output.EndRender();
}
示例2: Render
protected override void Render(HtmlTextWriter writer)
{
writer.BeginRender();
writer.AddAttribute("class", this.CssClass);
base.Render(writer);
writer.EndRender();
}
示例3: Render
/// <summary>
/// Shows the localized text string (if available)
/// </summary>
/// <param name="writer">
/// </param>
protected override void Render(HtmlTextWriter writer)
{
writer.BeginRender();
writer.Write(this.LocalizeAndRender(this));
writer.EndRender();
}
示例4: Render
//***************************************************************************
// Override Methods
//
protected override void Render(HtmlTextWriter writer)
{
writer.BeginRender();
try
{
// Get the filename for the currently executing page.
string curPgNm = System.IO.Path.GetFileName(this.Context.Request.PhysicalPath).Trim().ToLower();
StringBuilder sb = new StringBuilder("chevron.axd");
sb.AppendFormat("?h={0}&spc={1}", this._itemHeight, this._itemSpc);
if (this._itemWidth != -1)
sb.AppendFormat("&itmw={0}", this._itemWidth);
else
sb.AppendFormat("&w={0}", this._totalWidth);
sb.AppendFormat("&fnt={0}&fsz={1}&tpd={2}", this.FontName, this.FontSize.Unit.Value, this.FontPadding);
sb.AppendFormat("&bld={0}&itl={1}&twp={2}", (this.FontBold ? 1 : 0), (this.FontItalic ? 1 : 0), (this.TextWrap ? 1 : 0));
sb.AppendFormat("&tClr={0}&bClr={1}&fClr={2}", Hex.GetWebColor(this.ItemBackColor1).TrimStart('#'), Hex.GetWebColor(this.ItemBackColor2).TrimStart('#'), Hex.GetWebColor(this.ForeColor).TrimStart('#'));
sb.AppendFormat("&bdrClr={0}&atClr={1}&abClr={2}", Hex.GetWebColor(this.BorderColor).TrimStart('#'), Hex.GetWebColor(this.ActiveItemBackColor1).TrimStart('#'), Hex.GetWebColor(this.ActiveItemBackColor2).TrimStart('#'));
sb.AppendFormat("&ctClr={0}&cbClr={1}", Hex.GetWebColor(this.CompleteItemBackColor1).TrimStart('#'), Hex.GetWebColor(this.CompleteItemBackColor2).TrimStart('#'));
sb.AppendFormat("&acMd={0}&acOp={2}&bckClr={1}", (int)this._accentMode, Hex.GetWebColor(this.BackColor).TrimStart('#'), this._accentBaseOpac);
//sb.AppendFormat("&bvl={2}", this.Bevel);
sb.AppendFormat("&bdrWdt={0}", this.BorderWidth);
sb.AppendFormat("&bckTrns={0}&cmpTrns={1}&actTrns={2}&bdrTrns={3}", this.ItemAlpha, this.CompletedItemAlpha, this.ActiveItemAlpha, this.BorderAlpha);
sb.AppendFormat("&tsOn={0}", (this.TextShadow ? 1 : 0));
if (this.TextShadow)
sb.AppendFormat("&tsOp={0}", this.TextShadowAlpha);
if (!string.IsNullOrEmpty(this.CustomShapeFileUrl))
sb.AppendFormat("&shpFl={0}", this.CustomShapeFileUrl);
if (!string.IsNullOrEmpty(this.CustomShapeName))
sb.AppendFormat("&shpNm={0}", this.CustomShapeName);
int actIdx = -1;
List<string> parts = new List<string>();
List<string> imgs = new List<string>();
if (this._itemsCol.Count > 0)
{
for (int i = 0; i < this._itemsCol.Count; i++)
{
if (!string.IsNullOrEmpty(this._itemsCol[i].AssocPageName) && this._itemsCol[i].AssocPageName.Split('|').Any(s => s.Trim().ToLower() == curPgNm))
this._itemsCol[i].IsActive = true;
parts.Add(Context.Server.UrlEncode(this._itemsCol[i].Text));
if (this._itemsCol[i].IsActive)
actIdx = i;
if (this._itemsCol[i].ImageSrc != null)
{
string imgUrl = this._itemsCol[i].ImageSrc.OriginalString;
if (!this._itemsCol[i].ImageSrc.IsAbsoluteUri && !VirtualPathUtility.IsAbsolute(imgUrl))
imgUrl = VirtualPathUtility.ToAbsolute(imgUrl);
imgs.Add(Context.Server.UrlEncode(imgUrl));
}
else
imgs.Add(Context.Server.UrlEncode(" "));
}
if (actIdx == -1)
{
actIdx = 0;
this._itemsCol[0].IsActive = true;
}
}
sb.AppendFormat("&act={0}", actIdx);
sb.AppendFormat("&pcs={0}", string.Join("|", parts.ToArray()));
sb.AppendFormat("&img={0}", string.Join("|", imgs.ToArray()));
string url = sb.ToString();
if (url.Length > 2000)
throw new Exception("Chevron handler URL exceeds 2000 characters.");
writer.AddAttribute(HtmlTextWriterAttribute.Src, url);
writer.RenderBeginTag(HtmlTextWriterTag.Img);
writer.RenderEndTag();
}
finally
{ writer.EndRender(); }
}
示例5: RenderChildrenInternal
internal void RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
{
if ((this.RareFields != null) && (this.RareFields.RenderMethod != null))
{
writer.BeginRender();
this.RareFields.RenderMethod(writer, this);
writer.EndRender();
}
else if (children != null)
{
foreach (Control control in children)
{
control.RenderControl(writer);
}
}
}
示例6: Render
protected override void Render(HtmlTextWriter writer)
{
this.EnsureChildControls();
if (this._qData.DisplayType != FormElementDisplayType.HiddenField)
{
if (!string.IsNullOrEmpty(this._qData.HintText))
this.ControlContainer.Controls.Add(new LiteralControl(string.Format("<span class=\"dynamicFormElementHintText\">{0}</span>", this._qData.HintText)));
if (!string.IsNullOrEmpty(this._qData.Text))
this.ControlContainer.Controls.AddAt(0, new LiteralControl(string.Format("<span class=\"dynamicFormElementText\">{0}</span>", this._qData.Text)));
}
writer.BeginRender();
try
{
//this.ControlContainer.RenderControl(writer);
this.RenderContents(writer);
}
finally
{ writer.EndRender(); }
//base.Render(writer);
}
示例7: Render
//***************************************************************************
// Private Methods
//
protected override void Render(HtmlTextWriter writer)
{
this.EnsureChildControls();
writer.BeginRender();
try
{
FormElementControl.AddElementStyleAttributes(writer, this._qData);
writer.RenderBeginTag(HtmlTextWriterTag.Table);
for (int y = 0; y < this.RowCount; y++)
{
writer.RenderBeginTag(HtmlTextWriterTag.Tr);
for (int x = 0; x < this.ColumnCount; x++)
{
FormElementData[] cellData = this._qData.Children.Where(c => c.RowIndex == y && c.ColumnIndex == x).ToArray();
if (cellData.Length > 1)
// If we found more than one, I don't even want to try and
// figure out how to handle that one right now.
throw new Exception(string.Format("Row {0}, Column {1} of the grid contains more than one child cell definition. Cannot render more than one cell in each row/column intersect position.", y + 1, x + 1));
else if (cellData.Length < 1)
{
// If no child cell is found at this intersection, just render
// an empty table cell, so we don't "break" the HTML output.
writer.RenderBeginTag(HtmlTextWriterTag.Td);
writer.RenderEndTag();
}
else if (cellData[0].DisplayType != FormElementDisplayType.GridCell)
// If the item we found isn't for a grid cell, that's a problem.
// I'm not coding around that "weirdness". At least not yet.
throw new Exception(string.Format("Cannot render a form element of type {0} directly below a Grid element without a parent GridCell. Please check your data for correct parent/child hierarchy.", cellData[0].DisplayType));
else
{
// We've got data for a single cell, so create a control.
FormElementControl ctrl = FormElementControl.GetControl(cellData[0]);
this.Controls.Add(ctrl);
ctrl.RenderControl(writer);
}
}
writer.RenderEndTag(); // TR
}
writer.RenderEndTag(); // TABLE
}
finally
{ writer.EndRender(); }
base.Render(writer);
}
示例8: Render
/// <summary>
/// Shows the localized text string (if available)
/// </summary>
/// <param name="output">
/// </param>
protected override void Render(HtmlTextWriter output)
{
output.BeginRender();
output.Write("<strong>");
// Write Title
output.Write(
this.GetText(this.LocalizedPage, this.LocalizedTag).FormatWith(
this.Param0, this.Param1, this.Param2));
// Append Suffix
if (this.Suffix.IsSet())
{
output.Write(this.Suffix);
}
output.Write("</strong>");
output.Write("<br />");
output.Write("<em>");
// Write Help Text
output.Write(
this.GetText(this.LocalizedPage, this.LocalizedHelpTag).FormatWith(
this.ParamHelp0, this.ParamHelp1, this.ParamHelp2));
output.Write("</em>");
output.EndRender();
}
示例9: FillTextBox
private void FillTextBox()
{
var buffer = new StringWriter();
using (var html = new HtmlTextWriter(buffer))
{
html.RenderBeginTag("html");
html.RenderBeginTag(HtmlTextWriterTag.Head);
html.RenderBeginTag(HtmlTextWriterTag.Style);
html.BeginRender();
html.Write(Properties.Resources.ResizableTextAreaStyle);
html.EndRender();
html.RenderEndTag();//style
html.RenderEndTag();//head
html.RenderBeginTag("body");
html.RenderBeginTag("h1");
html.WriteEncodedText(string.Format("{0}.{1}", verb.EntityName, verb.Name));
html.RenderEndTag();
html.RenderBeginTag("table");
html.RenderBeginTag("tbody");
foreach (var verbArgument in verb.Arguments)
{
html.RenderBeginTag("tr");
html.RenderBeginTag("td");
html.WriteEncodedText(verbArgument.Name);
html.RenderEndTag();
html.RenderBeginTag("td");
switch (verbArgument.Type.ToLowerInvariant())
{
case "system.string":
case "system.int64":
case "system.int32":
case "system.int16":
case "system.byte":
case "system.boolean":
case "system.datetime":
html.AddAttribute(HtmlTextWriterAttribute.Id, "arg" + verbArgument.Position);
html.AddAttribute(HtmlTextWriterAttribute.Type, "text");
html.RenderBeginTag(HtmlTextWriterTag.Input);
html.RenderEndTag();
break;
default:
html.AddAttribute(HtmlTextWriterAttribute.Name, "outerDiv");
html.AddAttribute(HtmlTextWriterAttribute.Class, "outerDiv");
html.RenderBeginTag(HtmlTextWriterTag.Div);
html.AddAttribute(HtmlTextWriterAttribute.Class, "txtArea");
html.AddAttribute(HtmlTextWriterAttribute.Id, "arg" + verbArgument.Position);
html.RenderBeginTag(HtmlTextWriterTag.Textarea);
html.WriteEncodedText(verbArgument.XmlTemplate ?? "No template available");
html.RenderEndTag();//textarea
html.AddAttribute(HtmlTextWriterAttribute.Class, "corner");
html.RenderBeginTag(HtmlTextWriterTag.Div);
html.RenderEndTag(); //innerdiv
html.RenderEndTag();//outerdiv
break;
}
html.RenderEndTag();
html.RenderBeginTag("td");
html.WriteEncodedText(verbArgument.Type);
html.RenderEndTag();
html.RenderEndTag(); // tr
}
html.RenderEndTag(); // tbody
html.RenderEndTag(); // table
html.AddAttribute(HtmlTextWriterAttribute.Type, "button");
html.AddAttribute(HtmlTextWriterAttribute.Id, "invoke");
html.AddAttribute(HtmlTextWriterAttribute.Value, "Invoke");
html.RenderBeginTag(HtmlTextWriterTag.Input);
html.RenderEndTag();
html.RenderEndTag(); // body
html.RenderEndTag(); // html
}
webBrowser1.DocumentText = buffer.ToString();
}
示例10: Render
/// <summary>
/// Shows the localized text string (if available)
/// </summary>
/// <param name="output">
/// </param>
protected override void Render(HtmlTextWriter output)
{
output.BeginRender();
output.Write(this.LocalizeAndRender(this));
output.EndRender();
}
示例11: Render
/// <summary>
/// Renders the JBST control reference and any stored data to be used.
/// </summary>
/// <param name="writer"></param>
protected override void Render(HtmlTextWriter writer)
{
writer.BeginRender();
try
{
// render any named data items
if (this.dataItems != null && this.dataItems.Count > 0)
{
new DataBlockWriter(this.EnsureAutoMarkup()).Write(writer, this.dataItems);
}
// generate an ID for controls which do not have explicitly set
this.EnsureID();
this.Jbst.ID = this.ClientID;
this.Jbst.IsDebug = this.IsDebug;
// render JBST
if (this.HasControls())
{
this.Jbst.Write(writer, this.InlineData, this.Index, this.Count, this.RenderChildrenCallback);
}
else
{
this.Jbst.Write(writer, this.InlineData, this.Index, this.Count);
}
}
finally
{
writer.EndRender();
}
}
示例12: Render
/// <summary>
/// Renders the data items as a block of JavaScript
/// </summary>
/// <param name="writer"></param>
protected override void Render(HtmlTextWriter writer)
{
writer.BeginRender();
try
{
new DataBlockWriter(this.AutoMarkup, this.IsDebug).Write(writer, this.Data);
}
finally
{
writer.EndRender();
}
}
示例13: Render
protected override void Render(HtmlTextWriter writer)
{
this.EnsureChildControls();
writer.BeginRender();
try
{
if (string.IsNullOrEmpty(this.CssClass))
writer.AddAttribute(HtmlTextWriterAttribute.Class, "iconMenu");
else
writer.AddAttribute(HtmlTextWriterAttribute.Class, this.CssClass);
writer.RenderBeginTag(HtmlTextWriterTag.Div);
for (int i = 0; i < this.Controls.Count; i++)
this.Controls[i].RenderControl(writer);
writer.RenderEndTag();
}
finally
{
writer.EndRender();
}
// These are not the droids you're looking for.
//base.Render(writer);
}
示例14: RenderContents
protected override void RenderContents(HtmlTextWriter writer)
{
base.RenderContents(writer);
writer.BeginRender();
writer.AddAttribute("class", valueClass ?? "value");
writer.AddAttribute("id", ValueID);
writer.RenderBeginTag(HtmlTextWriterTag.Div);
object renderedValue = value;
if (RenderValue != null)
{
renderedValue = RenderValue(value);
}
if (renderedValue != null)
{
if (outputFormat == null)
{
renderedValue = renderedValue.ToString();
}
else
{
renderedValue = string.Format(outputFormat, renderedValue);
}
}
else
{
renderedValue = nullValue;
}
if (renderedValue != null)
{
if (this.encodeValue)
{
writer.WriteEncodedText((string )renderedValue);
}
else
{
writer.Write(renderedValue);
}
}
writer.RenderEndTag();
writer.EndRender();
}
示例15: Render
public void Render(HtmlTextWriter writer)
{
if (this.Text != "-")
{
writer.BeginRender();
writer.AddAttribute("role", "menuitem");
if (this.Enabled == false)
writer.AddAttribute(HtmlTextWriterAttribute.Disabled, "");
if (this.HasAttributes)
{
this.Attributes.AddAttributes(writer);
}
if (this.Value != null)
writer.AddAttribute("data-value", this.Value);
writer.RenderBeginTag(HtmlTextWriterTag.A);
writer.Write(this.Text); // 注意,不会自动转义的
writer.RenderEndTag();
writer.EndRender();
}
}