views:

110

answers:

3

HiEveryone!!! I'm using Master page in my website.... When the user logged in, the asp menu button of the master page should be enabled or disabled according to the user permission.... How to do this? Plz Reply!!!!!!!!

A: 

Declare a public method in the code behind of your master page which will load user permissions and enable or disable menu button.

In Master Page code behind.

Public void EnableMenuBar() {
 //.... Load user permissions here.
 //.... here make menu bar enable or disable. 
}

Then make this call in the end of your default constructor for your master page.

S M Kamran
I tried... But, can't see any button properties which I used in master page
Nila
Thank U! Permissions is just the particular user is enabled for some feature.. That's it.. I just want to access master page controls. But, I can't use it..
Nila
A: 

In master page Page_Load event check if user logged in then enable or disable menu button according to the user permission.

Himadri
Yes.... I tried that.... But, that menu Button has only two properties....
Nila
Is there 'Enabled' property for that menu Button? If yes then set Enabled=true or Enabled=falsePut the checking in Page_Load event under if(!IsPostback){}
Himadri
A: 

Thank U Everybody! I found the solution for it..... Code: Menu1.Items[3].Enabled=False

Nila