Hi,
i am developing an application in which i have created master page. i have 3 users in my application i.e admin, coordinator and user. depending on the user login i need to show and hide some menu items. For example for admin user i need to show menu1, menu2 and menu3,submenu1,submenu2, for coordinator i should show menu1 and menu2 and for user i need to show menu1 and menu3. i have created login page after enterinh username and password depending on user login i should show the menu. i am new to this kind of application please suggest me how to do this using asp.net.
With Regards
Ashwini
Loading
Santhosh Kumar JayaramanPosted Jun 8, 2012, 6:45 AM
In Login aspx, button click
then in master.aspx file. i added an id for Li control.
then in master.cs page_load
Please let me know if you have questions
AshwiniPosted Jun 8, 2012, 8:19 AM
Thank you very much. it's working fine now. Really great job thanks.
With Regards
Ashwini
Santhosh Kumar JayaramanPosted Jun 8, 2012, 7:38 AM
AshwiniPosted Jun 8, 2012, 7:30 AM
In the zip attached zip file i am unable to find any edited master page and other content pages, it contains only sisual stusio 2012 icon. please send me the edited pages. please check the file sent by you.
With Regards
Ashwini
Santhosh Kumar JayaramanPosted Jun 8, 2012, 6:23 AM
AshwiniPosted Jun 8, 2012, 4:41 AM
thanks for your replay.
Find the file attached for menu. i have sent the master page and 3 content pages actually lot many content pages are there. i think master page is enough to refer. mainly i am using login.aspx page to give the menu access depending on user login. please refer the code and suggest me.
With Regards
Ashwini
Santhosh Kumar JayaramanPosted Jun 8, 2012, 3:57 AM
AshwiniPosted Jun 8, 2012, 3:48 AM
i have not taken any label controls in menu. i am handling menu with unordered list of html. menu i have declared in master page. how to display it in content page. Suggest me
Santhosh Kumar JayaramanPosted Jun 8, 2012, 3:31 AM
void page_load()
{
if (user.role=="Coordinator)
{
lbl_Menu1.Visible=true;
lbl_Menu2.Visible=true;
lbl_Menu3.Visible=false;
}
else if (user.role=="User)
{
lbl_Menu1.Visible=true;
lbl_Menu2.Visible=false;
lbl_Menu3.Visible=true;
}
else if (user.role=="Admin)
{
lbl_Menu1.Visible=true;
lbl_Menu2.Visible=true;
lbl_Menu3.Visible=true;
}
}
like this you can make the menu items visible or hide.