0
如何添加樣式(htmlattribute)到每個項目,同時菜單結合的web.sitemap劍道菜單BindTo地圖和配置每個項目
的web.sitemap
<?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();
感謝