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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top