views:

126

answers:

2

Hi, 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?

A: 

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.

Ray Burns
A: 

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.

richeym