re:
And can you tell me which code line should I use to verify if a user is authenticated:
Request.IsAuthenticated.ToString, My.User.IsAuthenticated.ToString or
User.Identity.IsAuthenticated.ToString?
Which ones return valid responses ?
You can use any which return valid responses.
Remember, they will only produce valid results if you're using Forms Authentication and Membership.
They will *not* authenticate a user if you're using Windows Integrated Security.
Juan T. Llibre, asp.net MVP
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en español :
http://asp.net.do/foros/
===================================
"shapper" <md*****@gmail.comwrote in message
news:11**********************@16g2000cwy.googlegro ups.com...
Hi Juan,
It is working now. Could you tell me if this is the right way:
If Membership.ValidateUser("username", "pass") Then
FormsAuthentication.SetAuthCookie("shapper", True)
Response.Write(Request.IsAuthenticated.ToString)
Response.Write(My.User.IsAuthenticated.ToString)
Response.Write(User.Identity.IsAuthenticated.ToStr ing)
Else
Response.Write("# User is Not Authenticated #")
End If
And can you tell me which code line should I use to verify if a user is
authenticated:
Request.IsAuthenticated.ToString, My.User.IsAuthenticated.ToString or
User.Identity.IsAuthenticated.ToString?
Thank You,
Miguel
Juan T. Llibre wrote:
I have already explained to you that Authentication is not the same as validating Membership.
You will *always* get False when validating Membership data
against Authenticated users, who must login with Windows credentials.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"shapper" <md*****@gmail.comwrote in message
news:11**********************@f1g2000cwa.googlegro ups.com...
Hello,
I need to check if a user is authenticated. I tried everything I could
think and find:
If Membership.ValidateUser("shapper", "27lamps11") Then
Response.Write(Request.IsAuthenticated.ToString)
Response.Write(My.User.IsAuthenticated.ToString)
Response.Write(Me.User.Identity.IsAuthenticated.To String)
Else
Response.Write("# User is Not Authenticated #")
End If
I get "FalseFalseFalse".
What is going on?
Thanks,
Miguel