User on MasterPage


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
 
Ad

Advertisements

C

clintonG

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.
 
Ad

Advertisements

G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top