I am working on an inventory system, developing a website using asp.net & c#. I want that my menu gets invisible & visble as per the user role. Means if admin login then he can view all menus but if accountant login then he can view only some menu items only.
Please help,,its urgent
How to set visibility of menu item
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Mayur DigheRank #1,078 · 1.8K reputationPosted Feb 3, 2012, 6:02 AM EST
you can do this by simply calling some functions (e.g. LoginAdmin(), LoginAccnt() etc.), in which you can place a code to Enable or Disable the Menu Items........
For expected Result that you want, you need to call these functions at time of LOGIN with proper 'UserName' that you want...
Example:
Login Page:-
User Name: Admin
Password : Admin
Click 'Login' Button
@ 'OnClick' event of 'Login' Button:-
if(username=="Admin")
{ LoginAdmin(); }
else if(username=="Accountant")
{ LoginAccnt(); }
Functions:
LoginAdmin()
{
mnuBudget.Enable=true;
mnuPayment.Enable=true;
}
LoginAccnt()
{
mnuBudget.Enable=false;
mnuPayment.Enable=false;
}