Check if user is authenticated and get its profile. Thank you.

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I need to check if the current user is authenticated and get its
profile.

For authentication checking I got the following options:
Request.IsAuthenticated.ToString
My.User.IsAuthenticated.ToString
User.Identity.IsAuthenticated.ToString

Which one should I use?
And how can I get the profile?

Thanks,
Miguel
 
Hello Shapper,

S> I need to check if the current user is authenticated and get its
S> profile.
S> For authentication checking I got the following options:
S> Request.IsAuthenticated.ToString My.User.IsAuthenticated.ToString
S> User.Identity.IsAuthenticated.ToString
S> Which one should I use?

Anyone, they are the same (u can sure it using Reflector)

S> And how can I get the profile?

smth like
ProfileCommon pc = (ProfileCommon)context.Profile;
pc = pc.GetProfile("johndoe");


---
WBR, Michael Nemtsev [C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
 
Hello Shapper,

S> I need to check if the current user is authenticated and get its
S> profile.
S> For authentication checking I got the following options:
S> Request.IsAuthenticated.ToString My.User.IsAuthenticated.ToString
S> User.Identity.IsAuthenticated.ToString
S> Which one should I use?

Anyone, they are the same (u can sure it using Reflector)

S> And how can I get the profile?

smth like
ProfileCommon pc = (ProfileCommon)context.Profile;
pc = pc.GetProfile("johndoe");

Those lines you wrote get the profile of a given user.
But what about the profile of the user which is currently
authenticated?
---
WBR, Michael Nemtsev [C# MVP].
My blog:http://spaces.live.com/laflour
Team blog:http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

Thanks,
Miguel
 
Back
Top