本文整理汇总了C#中HtmlTags.HtmlTag.Nest方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTag.Nest方法的具体用法?C# HtmlTag.Nest怎么用?C# HtmlTag.Nest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlTags.HtmlTag
的用法示例。
在下文中一共展示了HtmlTag.Nest方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddLogout
private static void AddLogout(HtmlTag header)
{
var logout = Tags.Link.Attr(HtmlAttributeConstants.Href, "authentication/logout")
.Text("(logout)");
header.Nest(logout);
}
示例2: AddTitle
private static void AddTitle(HtmlTag header)
{
var currentUser = UserPrincipal.Current.User;
var userName = currentUser != null ? currentUser.Name : string.Empty;
var title = Tags.SpanText("Feedback - " + userName);
header
.Nest(title);
}
示例3: AddAdminLink
private static void AddAdminLink(HtmlTag header)
{
var currentUser = UserPrincipal.Current.User;
var isAdmin = currentUser != null && currentUser.Role.HasFlag(Roles.Admin);
if (isAdmin)
{
var admin = Tags.Link.Attr(HtmlAttributeConstants.Href, "admin/index")
.Text("(admin)");
header.Nest(admin);
}
}
示例4: AddCriteria
private void AddCriteria(HtmlTag div)
{
var table = Tags.Table;
var row = table.AddBodyRow();
row.Cell("Target:");
row.Cell().Nest(Tags.Span.DataBind("text: Target"));
row = table.AddBodyRow();
row.Cell("Source:");
// todo Ability to view from all sources
row.Cell().Nest(Tags.Span.DataBind("text: Source"));
row = table.AddBodyRow();
row.Cell("Metric:");
row.Cell().Nest(Tags.Span.DataBind("text: Metric"));
div.Nest(table);
}
示例5: AddFeedback
private void AddFeedback(HtmlTag div)
{
var table = Tags.Table.Caption("Feedback");
var headerRow = table.AddHeaderRow();
headerRow.Cell("Date");
headerRow.Cell("From");
headerRow.Cell("Rating");
headerRow.Cell("Notes");
headerRow.Cell();
var addRow = new TableRowTag();
addRow.AddClass("top");
addRow.Cell().Nest(Tags.Span.DataBind("text: Date"));
addRow.Cell().Nest(Tags.Span.DataBind("text: Source"));
addRow.Cell().Nest(new GiveFeedback().InputFor(x => x.Rating).DataBind("value: Rating"));
addRow.Cell().Nest(new HtmlTag("textarea").DataBind("value: Notes"));
addRow.Cell().Nest(
Tags.Link.Href("#").Text("Save").DataBind("click: function() { $parent.saveFeedback(); }"));
var addBody = new HtmlTag("tbody").DataBind("with: NewFeedback");
addBody.Nest(addRow);
var noteRow = new TableRowTag();
noteRow.AddClass("note");
noteRow.Cell().Nest(Tags.Span.DataBind("text: Date"));
noteRow.Cell().Nest(Tags.Span.DataBind("text: Source"));
noteRow.Cell().Nest(Tags.Span.DataBind("text: Rating"));
noteRow.Cell().Nest(new HtmlTag("pre").Style("white-space", "pre-wrap").DataBind("text: Notes"));
noteRow.Cell();
var notesBody = new HtmlTag("tbody").DataBind("foreach: Feedback");
notesBody.Nest(noteRow);
table.Nest(
addBody,
notesBody
);
table.AddClasses("report", "no-hover");
div.Nest(table);
}
示例6: GetFeedbackTemplate
public static HtmlTag GetFeedbackTemplate()
{
var table = Tags.Table.Caption("Feedback");
var headerRow = table.AddHeaderRow();
headerRow.Cell("Date");
headerRow.Cell("From");
headerRow.Cell("Rating");
headerRow.Cell("Notes");
headerRow.Cell();
var addRow = new TableRowTag();
addRow.AddClass("top");
addRow.Cell().Nest(Tags.Span.DataBind("text: Date"));
addRow.Cell().Nest(Tags.Span.DataBind("text: Source"));
addRow.Cell().Nest(new GiveFeedback().InputFor(x => x.Rating).DataBind("value: Rating"));
addRow.Cell().Nest(new HtmlTag("textarea").DataBind("text: Notes"));
addRow.Cell().Nest(Tags.Link.Href("#").Text("Save").DataBind("click: function() { $parent.saveNote(); }"));
var addBody = new HtmlTag("tbody").DataBind("with: Note");
addBody.Nest(addRow);
var noteRow = new TableRowTag();
noteRow.AddClass("note");
noteRow.Cell().Nest(Tags.Span.DataBind("text: Date"));
noteRow.Cell().Nest(Tags.Span.DataBind("text: Source"));
noteRow.Cell().Nest(Tags.Span.DataBind("text: Rating"));
noteRow.Cell().Nest(Tags.Span.DataBind("text: Notes"));
noteRow.Cell();
var notesBody = new HtmlTag("tbody").DataBind("foreach: Feedback");
notesBody.Nest(noteRow);
table.Nest(
addBody,
notesBody
);
return table.AddClasses("report", "no-hover");
}