By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,127 Members | 1,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,127 IT Pros & Developers. It's quick & easy.

Login LoggedIn event and Profile object question

P: n/a
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.
May 24 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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;
}

"Rusty Hill" <Ru********@hotmail.comwrote in message
news:OC**************@TK2MSFTNGP06.phx.gbl...
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.


May 24 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.