本文整理汇总了C#中Common.System.RenderBeginTag方法的典型用法代码示例。如果您正苦于以下问题:C# System.RenderBeginTag方法的具体用法?C# System.RenderBeginTag怎么用?C# System.RenderBeginTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Common.System
的用法示例。
在下文中一共展示了System.RenderBeginTag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteHtml
public override void WriteHtml(System.Web.UI.HtmlTextWriter w)
{
/*
//set code language
if (Language == CompiledQuestion.LANGUAGE.CPP)
{
LanguageToHighlight = HtmlHighlightedCode.LANGUAGE.Cpp;
}
else if (Language == CompiledQuestion.LANGUAGE.CS)
{
LanguageToHighlight = HtmlHighlightedCode.LANGUAGE.Cpp;
}
else if (Language == CompiledQuestion.LANGUAGE.Delphi)
{
LanguageToHighlight = HtmlHighlightedCode.LANGUAGE.Delphi;
}
else if (Language == CompiledQuestion.LANGUAGE.Java)
{
LanguageToHighlight = HtmlHighlightedCode.LANGUAGE.Java;
}
* */
//<div>
w.AddAttribute(HtmlAttribute.Id, Name);
w.AddAttribute(HtmlAttribute.Name, "advancedCompiledTest");
w.AddStyleAttribute(HtmlStyleAttribute.Position, "absolute");
HtmlSerializeHelper<HtmlCompiledTest>.WriteRootElementAttributes(w, this);
w.RenderBeginTag(HtmlTag.Div);
//var ls = LanguageToHighlight.ToString().ToLower();
//<span name="BeforeCode">//there will be lector code
w.AddAttribute(HtmlAttribute.Id, "TextBoxBefore");
w.AddStyleAttribute(HtmlStyleAttribute.Overflow, "scroll");
w.AddStyleAttribute(HtmlStyleAttribute.Height, (Control as AdvancedCompiledTest).TextBoxBefore.Height.ToString());
w.AddStyleAttribute(HtmlStyleAttribute.Width, (Control as AdvancedCompiledTest).TextBoxBefore.Width.ToString());
w.RenderBeginTag(HtmlTag.Span);
//w.AddAttribute(HtmlAttribute.Class, ls);
//w.WriteFullBeginTag(string.Concat("pre><code class=\"", ls, "\""));
w.WriteFullBeginTag(string.Concat("pre><code"));
w.Write((Control as AdvancedCompiledTest).TextBoxBefore.Text.HttpEncode());
w.WriteFullBeginTag("/code></pre");
w.RenderEndTag();
//</span>
//<textarea>//there will be user code
w.AddAttribute(HtmlAttribute.Id, "TextBoxUserCode");
w.AddStyleAttribute(HtmlStyleAttribute.Width, (Control as AdvancedCompiledTest).TextBoxUserCode.Width.ToString());
w.AddStyleAttribute(HtmlStyleAttribute.Height, (Control as AdvancedCompiledTest).TextBoxUserCode.Height.ToString());
w.RenderBeginTag(HtmlTextWriterTag.Textarea);
w.RenderEndTag();
//</textarea>
//<span name="AfterCode">//there will be lector code
w.AddAttribute(HtmlAttribute.Id, "TextBoxAfter");
w.AddStyleAttribute(HtmlStyleAttribute.Overflow, "scroll");
w.AddStyleAttribute(HtmlStyleAttribute.Height, (Control as AdvancedCompiledTest).TextBoxAfter.Height.ToString());
w.AddStyleAttribute(HtmlStyleAttribute.Width, (Control as AdvancedCompiledTest).TextBoxAfter.Width.ToString());
w.RenderBeginTag(HtmlTag.Span);
//w.AddAttribute(HtmlAttribute.Class, ls);
//w.WriteFullBeginTag(string.Concat("pre><code class=\"", ls, "\""));
w.WriteFullBeginTag(string.Concat("pre><code"));
w.Write((Control as AdvancedCompiledTest).TextBoxAfter.Text.HttpEncode());
w.WriteFullBeginTag("/code></pre");
w.RenderEndTag();
//</span>
w.RenderEndTag();
//</div>
}