本文整理汇总了C#中System.Web.UI.HtmlControls.HtmlGenericControl.GetHtml方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlGenericControl.GetHtml方法的具体用法?C# HtmlGenericControl.GetHtml怎么用?C# HtmlGenericControl.GetHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.HtmlControls.HtmlGenericControl
的用法示例。
在下文中一共展示了HtmlGenericControl.GetHtml方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteProgressBar
private static void WriteProgressBar(TextWriter writer)
{
HtmlGenericControl container = new HtmlGenericControl("div");
container.ID = "progressArea";
HtmlGenericControl progressContainer = new HtmlGenericControl("div");
container.Controls.Add(progressContainer);
progressContainer.ID = "progressContainer";
progressContainer.Style["width"] = "100%";
progressContainer.Style["height"] = "20px";
progressContainer.Style["border"] = "1px solid silver";
HtmlGenericControl progressBar = new HtmlGenericControl("div");
progressContainer.Controls.Add(progressBar);
progressBar.ID = "progressBar";
progressBar.Style["text-align"] = "left";
progressBar.Style["width"] = "0%";
progressBar.Style["height"] = "20px";
progressBar.Style["background-color"] = "blue";
HtmlGenericControl statusText = new HtmlGenericControl("div");
container.Controls.Add(statusText);
statusText.ID = "statusText";
statusText.Style["text-align"] = "left";
statusText.Style["padding-left"] = "8px";
statusText.Style["padding-right"] = "8px";
writer.Write(container.GetHtml());
}
示例2: WriteGridTitle
private void WriteGridTitle(HtmlTextWriter writer)
{
if (this.GridTitle.IsNotEmpty())
{
HtmlGenericControl divHeader = new HtmlGenericControl("div");
divHeader.Attributes["class"] = "table-header";
HtmlGenericControl divTitle = new HtmlGenericControl("div");
divTitle.Attributes["class"] = "dataTables-title";
divHeader.Controls.Add(divTitle);
divHeader.CreateSubItems("span", span => span.InnerText = Translator.Translate(this.Category, this.GridTitle));
writer.Write(divHeader.GetHtml());
}
}