本文整理汇总了C#中System.Web.UI.HtmlTextWriter.H1方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTextWriter.H1方法的具体用法?C# HtmlTextWriter.H1怎么用?C# HtmlTextWriter.H1使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.HtmlTextWriter
的用法示例。
在下文中一共展示了HtmlTextWriter.H1方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCode
private string GetCode()
{
var stringWriter = new StringWriter();
using (var writer = new HtmlTextWriter(stringWriter))
{
writer
.Class("border-bottom p-3 mb-3")
.Div(() => writer
.H1(Title)
);
}
return stringWriter.ToString();
}
示例2: GeneratePageString
private void GeneratePageString()
{
var strWr = new StringWriter();
using (var writer = new HtmlTextWriter(strWr))
{
writer
.WriteString("<!DOCTYPE html>")
.NewLine()
.Tag(HtmlTextWriterTag.Head, () => writer
.Tag(HtmlTextWriterTag.Meta, new Dictionary<string, string>
{
{"http-equiv", "X-UA-Compatible"},
{"content", @"IE=edge"},
{"charset", "utf-8"}
})
.Title(PageTitle)
.Scripts(ScriptFilePaths)
.TagIf(!PageScriptString.Equals(""), HtmlTextWriterTag.Script, PageScriptString)
.Type(@"text/css")
.Tag(HtmlTextWriterTag.Style)
.Stylesheets(PageStylePaths)
)
.Tag(HtmlTextWriterTag.Body, () => writer
.Class("border-bottom p-3 mb-3 bg-gray")
.Div(() => writer
.Class("container")
.Div(() => writer
.TextAlign("center")
.Div(() => writer
.H1(PageTitle)
)
)
)
.Class("container")
.Tag(HtmlTextWriterTag.Div, () => writer
.Write(PageBodyCode)
)
)
.NewLine()
.Footer(FooterSection.HtmlCode)
.NewLine()
.WriteString("</html>")
.NewLine();
}
FullPage = strWr.ToString();
}