473,409 Members | 1,943 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

Login LoggedIn event and Profile object question

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
1 3506
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ruju00 | last post by:
I am getting an error in Login() method of the following class FtpConnection public class FtpConnection { public class FtpException : Exception { public FtpException(string message) :...
5
by: Shimon Sim | last post by:
I am working with LogIn control and need to set some property for profile after user is authenticated. I thought that LoggedIn event is the right place but system tells me that the property can't...
0
by: Ashkan Daie | last post by:
Hi All, When using forms authentication with IIS 6.0, I can create a user and log in the user. But the LoginStatus control states that the user is logged out. When running the same app using...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
3
by: =?Utf-8?B?TWFyY0c=?= | last post by:
I have a Server.Transfer in my asp:Login LoggedIn event handler. I am forcing transfer to a specific page since I do not want to use the ReturnURL that is in Request.Params (i.e., the user...
0
by: =?Utf-8?B?Um9iZXJ0byBSYXp6YXV0aQ==?= | last post by:
I've a problem to change a profile property during button click event in a login.aspx page. I try to set profile.property = xxx but after authentication this property remain to defaultvalue by...
2
by: kpg* | last post by:
Hi all, asp.net 2.0 I'm using the login control with no frills to authenticate users. I want to add a value to the user's profile when the user successfully logs in, but I want to do this...
1
by: Kandiman | last post by:
Hiya, i made a asp page, and one of my divs (as a include) is as below. the problem is if the main page is resubmitted, i get logged out again?... heres the code.. i think its on the value=true...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.