开发者

ASP.net menu only show certain nodes in Web.sitemap

I have a few items apart 开发者_如何转开发of my Web.sitemap file that rely on querystring or session variables. I do not want these items to appear in my menu.

Is there a way to hide it from the menu, but still be in the sitemap (for sitepath control).

Thanks


I used this article when I wanted to stop an node from appearing I found this article great:

http://runtingsproper.blogspot.com/2009/11/i-bet-you-didn-know-that-adding-custom.html

ASP.NET does have functionality to control which nodes you want displayed but I believe this is tied to Membership/Roles.


Solved it...

I just made the title of the siteMapNode I want to be hidden to "[hidden]". In the .cs file the sitemap control sits I did this...

protected void rmMenu_ItemDataBound(object sender, RadMenuEventArgs e)
{
    if (e.Item.Text == "[hidden]")
    e.Item.Remove();
}


I believe you use the attribute show="false", like so:

<siteMapNode show="false" url="~/admin/submissionsaddedit.aspx" title="Add/Edit Submission"  description="" roles="Administrator, Shortlister, Moderator"/>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜