Click here to Skip to main content
15,909,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends Help Me...

Is it possible to dynamically change the masterpage (hide/ shoe few links) dependent on two login form... like parents login & student login


i have two login froms


Parent Login
Student login


if me logged by parent login i need to show change password option(link)

else if go by student login i need not view that option...



Thanks in advance
Posted
Updated 28-Jun-12 21:16pm
v2

You can access your controls in the master page from a "child" page in this way:

C#
Label lblInMasterPage =  this.Master.FindControl("lblMyLabel") as Label;



Than you can just call easly all the properties on the control you just retrieved, in this case lblInMasterPage.Visible = false; .

Hope this helps.

Cheers
 
Share this answer
 
v2
If you are using ASP.NET Membership for the login, you can use the feature called SecurityTrimming which enables to hide and show certain links based on the Role of the logged in User. You need to configure your sitemap accordingly. For more details please check out the MSDN Documentation regarding SecurityTrimming here[^] or check out a blog on it here[^].

Do let me know if this is the situation, else I will update the answer accordingly. Thank you.
 
Share this answer
 
I told you rajendran there are so many ways for your question. I already given you one of the easy example but then also try follow code:

C#
if(session("userrole")=="Parent"
{
 lnkChangePassword.Visible=True;
}
else if(session("userrole")=="Student"
{
 lnkChangePassword.Visible=False;
}



mark it answer if you got your solution so that other may refer.

Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900