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

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
 
M

Michael Nemtsev

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
 
S

shapper

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top