本文整理汇总了C#中HtmlTags.HtmlTag.Encoded方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTag.Encoded方法的具体用法?C# HtmlTag.Encoded怎么用?C# HtmlTag.Encoded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlTags.HtmlTag
的用法示例。
在下文中一共展示了HtmlTag.Encoded方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ScriptTag
public ScriptTag(string mode, Func<string, string> toFullUrl, Asset asset, string defaultUrl = null)
: base("script")
{
// http://stackoverflow.com/a/1288319/75194
Attr("type", "text/javascript");
if (asset == null)
{
Attr("src", toFullUrl(defaultUrl));
return;
}
if (asset.CdnUrl.IsNotEmpty())
{
Attr("src", asset.CdnUrl);
if (asset.FallbackTest.IsNotEmpty() && asset.File != null)
{
Next = new HtmlTag("script");
var text = "if ({0}) document.write(unescape(\"%3Cscript src='{1}' type='text/javascript'%3E%3C/script%3E\"));".ToFormat(asset.FallbackTest, asset.Url);
Next.Encoded(false);
Next.Text(text);
}
return;
}
var url = asset.Url;
if (mode.InDevelopment() && asset.File != null)
{
url += "?Etag=" + asset.File.Etag();
}
Attr("src", toFullUrl(url));
}
示例2: get__fubu
public DashboardModel get__fubu()
{
var files = _files.FindFiles(FileSet.Deep("fubu-diagnostics/*.html"));
var htmlTags = files.Select(x => {
var contents = x.ReadContents();
var tag = new HtmlTag("div").Id(Path.GetFileNameWithoutExtension(x.Path));
tag.Encoded(false);
tag.Text(contents);
tag.Hide();
tag.AddClass("left-content");
return tag;
}).ToArray();
var allJS = findAssets(MimeType.Javascript).ToArray();
var javascript = allJS.Where(x => !x.Filename.Contains(".jsx."));
var react = allJS.Where(x => x.Filename.Contains(".jsx."));
return new DashboardModel
{
StyleTags = findAssets(MimeType.Css).Select(x => new StylesheetLinkTag(_request.ToFullUrl(x.Url))).ToArray().ToTagList(),
ScriptTags = javascript.Select(x => new ScriptTag(_ => _request.ToFullUrl(_), x)).ToArray().ToTagList(),
Router = _routeWriter.WriteJavascriptRoutes("FubuDiagnostics.routes", _routes),
ReactTags = react.Select(x => new ScriptTag(_ => _request.ToFullUrl(_), x).Attr("type", "text/jsx")).ToArray().ToTagList(),
HtmlTags = htmlTags.ToTagList()
};
}