如何在菜单绑定到 web.sitemap 时为每个项目添加样式(htmlattribute)
网站地图
<?xml version="1.0" encoding="utf-8" ?>
<siteMap>
<siteMapNode title="Home" controller="Home" action="Overview">
<siteMapNode title="Grid">
<siteMapNode controller="grid" action="index" title="First Look (Razor)" area="razor"/>
<siteMapNode controller="grid" action="index" title="First Look (ASPX)" area="aspx"/>
</siteMapNode>
<siteMapNode title="Menu">
<siteMapNode controller="menu" action="index" title="First Look (Razor)" area="razor"/>
<siteMapNode controller="menu" action="index" title="First Look (ASPX)" area="aspx"/>
</siteMapNode>
</siteMapNode>
</siteMap>
剑道菜单绑定到 web.sitemap
Html.Kendo().Menu()
.Name("Menu")
.BindTo("web", (item, value) => {
if(item.Text.Equals("Home"))
{
item.Enabled = false;
// how can i add css style to the item here
}
})
.Render();
谢谢