Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

Master Pages with Login Status

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cs_in_va - 06 Mar 2008 22:41 GMT
I'm trying to write a notification button on my master page so if
someone is logged in it will display some text in a label.

But I don't get the user.identity.isauthenticated in my code behind
file.  What do I need to import?

Thanks
Mark Fitzpatrick - 07 Mar 2008 04:09 GMT
Because you're using a masterpage, it's inheriting from a different base
class. Normally, the User.Identity is available in a page since it inherits
from System.Web.UI.Page. That said, what you can do is access it from the
masterpage by doing Page.User.Identity.IsAuthenticated.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression

> I'm trying to write a notification button on my master page so if
> someone is logged in it will display some text in a label.
[quoted text clipped - 3 lines]
>
> Thanks
Paulus E Kurniawan - 07 Mar 2008 04:18 GMT
In your case, you will have to use:

HttpContext.Current.User.Identity.IsAuthenticated

From an aspx page code-behind, you can use User.Identity.IsAuthenticated
because User is a property of Page class which uses HttpContext object's User
property.

Hope this helps.

Signature

Paulus E Kurniawan
http://www.paulusevan.net

> I'm trying to write a notification button on my master page so if
> someone is logged in it will display some text in a label.
[quoted text clipped - 3 lines]
>
> Thanks

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.