我有一个包含许多标签的标签条。我需要为我的子标签分配一个id。我需要在此处为标签Demo指定id。请帮助解决这个问题
Html.Telerik().TabStrip().Name("Tab1")
.Items(items =>
{
items.Add()
.Text("Demo").HtmlAttributes(new { onclick = "return warnOfChanges()" })
.LoadContentFrom("EDemo", "W2Generation", new {q=Type.Error, cId = Model.C.CId, eId = Model.SelectedE,fYear = Model.Selectedyear });
items.Add().HtmlAttributes(new { onclick = "return warnOfChanges()" })
答案 0 :(得分:1)
您可以将ID添加为HtmlAttribute。
items.Add()
.Text("Demo").HtmlAttributes(new { onclick = "return warnOfChanges()", id = "demoTab"})
.LoadContentFrom("EDemo", "W2Generation", new {q=Type.Error, cId = Model.C.CId, eId = Model.SelectedE,fYear = Model.Selectedyear });