Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

masterpage and Identity.IsAuthenticated

Status
Not open for further replies.

pmbtech

Programmer
Nov 24, 2003
47
US
no matter what I try, my master page always returns false for Identity.IsAuthenticated.
I know I am authenticated or I wouldn't be sent to this page.
I have tried;
Page.User.Identity.IsAuthenticated - always false
HttpContext.Current.User.Identity.IsAuthenticated - always false
I have the code in the page_load of the master page.

I have been going nuts with this.
I am going to this page from the loggedIn event on the login page. I have used server.transfer and response.redirect to send me there but there was no difference.
My loggedin event redirects based on the role the user is in.

my page_load code is:

If Not Page.User.Identity.IsAuthenticated Then
Server.Transfer("~/Login.aspx")
End If

my LoggedIn code is:

Server.Transfer("~/Admin/Default.aspx")

----
Any ideas would be great.

 
Try this:

Code:
if (System.Threading.Thread.CurrentPrincipal.Identity.IsAuthenticated)
            {
                //...
            }

HTH

Smeat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top