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