开发者

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:

  1. Override OnPreRender in my page
  2. Use Page.Master.FindControl("ctrlLinkBar") to find the link bar
  3. 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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜