asp.net visibility of an element in master page
I need to set visibility for an option called SVN in a navigation bar for a web form as false.
this is its code in the master page....
if (page.CurrentUser.Permissions.开发者_运维问答SVN()) ctrlLinkBar.AddLink("SVN", "SVN.aspx");
how do i do that?
I would:
- Override OnPreRender in my page
- Use Page.Master.FindControl("ctrlLinkBar") to find the link bar
- Remove any links on it with the name "SVN"
I'm assuming you can't just change the formula on the master page.
This is a great article on Master Pages:
http://odetocode.com/articles/450.aspx
The 'Content Page to Master Page Interaction' section shows how you can do this using strongly typed properties.
精彩评论