Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / May 2007

Tip: Looking for answers? Try searching our database.

Login LoggedIn event and Profile object question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rusty Hill - 24 May 2007 18:27 GMT
My site does not allow anonymous users.  After a user has logged in and been
authenticated I need to access some information in their profile object.  I
thought I would do this in the LoggedIn event of the Login object but when
that event fires the user is still not authenticated so the profile is null.

Where and how should I be doing this?  Should I be checking the
ProfileModule.MigrateAnonymous Event in the global.asax?  Remember I do not
allow anonymous users at all and just want to grab a custom property from
the profile object the moment I know who the user is and have access to
their specific of the profile object.  Thank you.
Rusty Hill - 24 May 2007 20:38 GMT
I had to get creative and here is how I solved it:

   protected void Login1_LoggedIn(object sender, EventArgs e)
   {
       // Get the login object
       Login login = sender as Login;

       // Get the profile for the logged in user
       ProfileCommon usersProfile = Profile.GetProfile(login.UserName);

       // Go set the session UI culture
       if (usersProfile.PreferredUICulture != "")
           Session["PreferredUICulture"] = Profile.PreferredUICulture;
   }

> My site does not allow anonymous users.  After a user has logged in and
> been authenticated I need to access some information in their profile
[quoted text clipped - 7 lines]
> from the profile object the moment I know who the user is and have access
> to their specific of the profile object.  Thank you.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.