User on MasterPage

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

trying to access User in a MasterPage to determine current user's role, but I
get
"the name User does not exist in current context"

Is there any way I can access this property to modify what is displayed on
the master page based on the user's role?

Thanks for any suggestions
 
Use Intellisense: HttpContext.Current.User

Otherwise you have to type the Master to reference its controls by putting
the following into each content page...

<%@ MasterType VirtualPath="~/Masters/Whatever.master"%>

Then use public properties or the FindControl method to reference controls
in the Master or in content pages.
 
Thanks for this, I was stumped!

clintonG said:
Use Intellisense: HttpContext.Current.User

Otherwise you have to type the Master to reference its controls by putting
the following into each content page...

<%@ MasterType VirtualPath="~/Masters/Whatever.master"%>

Then use public properties or the FindControl method to reference controls
in the Master or in content pages.
 
Back
Top