Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ProfileBase.UserName and forms auth via the Login control

Thread Tools

ProfileBase.UserName and forms auth via the Login control

Keith Patrick
Posts: n/a
Currently, if I declare an asp:Login control on a page and login, on both
OnAuthenticate and OnLoggedIn, this.Profile.UserName is still null, even
though the user does get authenticated and shows up as such on the main
page. However, I have to set some profile values as soon as the user logs
in, but because those events still are within the scope of the "anonymous"
profile, I can't access the profile for the user that logged in. Is what
I'm trying to do possible, and if so, at what point do I get the current
user's profile?

Reply With Quote
Keith Patrick
Posts: n/a
FYI: after redoing my search terms, I found a solution (and explanation)
from when the thing was called HttpProfileBase:

Profiles are handled by an HttpModule. By the time OnLoggedIn (OT, but the
Login/Logout ASP vs. FXCop duelling standards is driving me nuts) is called,
the profile module has already executed for this request, so the profile
can't be updated *after* login/logon, unless you manually do it. So here's
the code to do so:
ProfileBase profile = ProfileBase.Create(this.Logon.UserName,
profile["MyProp"] = "MyValue";
profile.Save(); // This is necessary even with
automaticSaveEnabled because the module won't re-run to check IsDirty

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
windows auth and forms auth Smokey Grindle ASP .Net 1 06-08-2006 03:14 PM
Forms Auth Info passed to Windows Auth? ASP .Net Security 1 05-03-2005 11:47 AM
Windows Auth, but Forms Auth for one page? =?Utf-8?B?ZGhucml2ZXJzaWRl?= ASP .Net 1 01-08-2005 05:50 PM
Configuring Windows Auth & Forms Auth in Asp.Net Chris Mohan ASP .Net Security 2 04-29-2004 06:46 AM
Configuring Windows Auth & Forms Auth in Asp.Net =?Utf-8?B?Q2hyaXMgTW9oYW4=?= ASP .Net 0 04-28-2004 06:11 PM