473,395 Members | 1,471 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

User on MasterPage

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

Aug 3 '06 #1
2 3141
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.

--
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
"Dabbler" <Da*****@discussions.microsoft.comwrote in message
news:96**********************************@microsof t.com...
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

Aug 3 '06 #2
Thanks for this, I was stumped!

"clintonG" wrote:
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.

--
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
"Dabbler" <Da*****@discussions.microsoft.comwrote in message
news:96**********************************@microsof t.com...
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


Aug 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Scott | last post by:
I'm using a master page (mp_TableMaint.aspx) with one Content area (ID: Content1). Content1 contains several usercontrols, which are hidden. The goal is to show the correct control based on the...
1
by: rh | last post by:
Hi, My MasterPage contains a user control used for navigation. I have some .aspx pages that use this MasterPage and I would like to cache only the user control used for navigation. How do I...
13
by: Michael | last post by:
I have setup a public variable in the Master Page "code-behind-file". Now I would like to set that value from the UserControl, but I can't seem to find a way to do this. Does anyone have any ideas?...
1
by: yoknows | last post by:
Hello .Net Gurus. This is my first post here so I apologize in advance if I have not provided the right information. I hope someone has seen this problem before and can tell me what I am doing...
1
by: Dabbler | last post by:
I have some hyperlink controls on a master page I need to disable till my user has made some selections in a user control on a page based on the master page. How do I reference the Hyperlink...
0
by: benjamin.soulier | last post by:
Hello everyone, here is the problem I got : I have a Base Web User Control (like a user control containing a border, for design purpose). In this User Control, I put a PlaceHolder, and I put a...
1
by: =?Utf-8?B?U2VtU2Vt?= | last post by:
Helloz iam working in a web application for univesity. ihave diffrent kind of roles like: 1-Studetn Affairs 2-Staff imake three sperate master pages for them.: example:
9
by: J055 | last post by:
Hi I have a standard asp page which uses a MasterPage. The MasterPage contains a User control. How can I access a public method in the User control from my WebForm page? I can't move the method...
2
by: Rissoman | last post by:
I have two user controls on a master page. I can easily bubble up an event on usercontrol 1 from a click event to the page.aspx, than then calls a method on the masterpage, but this causes the...
10
by: Cirene | last post by:
I know that sometimes referring to controls deep in a page using a Master Page can be funky. For a website using a standard header/footer/nav, do you prefer using User Controls for the common...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.