473,287 Members | 1,813 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,287 software developers and data experts.

Profile Problems

Dear Friends,

I am having problems with the following:

I have added a Login control to a web page. In the Login control's
Authenticate event, I am performing additional validation against our
database to make sure a user exists. If all goes well, I set the
e.Authenticated property equal to True. At the same time, (while still in
the Authenticate event), I retrieve a row from our database which contains
user specific information (Name, Address, etc....). Here is where the
problem lies:

In my Web.Config file, I have defined a profile which basically looks
like the information row retrieved. For each profile property, I add the
allowAnonymous=false attribute as I only want to allow authenticated users
onto my site with their specific profile loaded from our database. When I
try to assign the properties from my database row to the profile
(Profile.FirstName = CurrentUserNameField), I receive an error stating that I
am still anonymous and that I cannot assign properties to profile that does
not allow for anonymous users. I can use the above code in any other page
and it will work correctly, but from within the Login control's Authenticate,
and LoggedIn events, I seem to be still anonymous although I am not. Its
almost like I have to leave those events for Profile property assignment.
Can anyone please help me?

Regards,

Giovanni
May 13 '06 #1
1 1379
That's because for the request where the user is submitting their username/passwrd
they're not yet authenticated, thus the profile isn't loaded for that specific
user. The Profile loading code doesn't know if the username/password submitted
are wrong, so it really can't automatically load the profile until the next
request.

Now, you can manually load and save the profile if you'd like from the Authenticate
event:

ProfileCommon theProfile = Profile.GetProfile("TheUserName");
theProfile.SomeValue = 5;
theProfile.Save();

-Brock
http://staff.develop.com/ballen

Dear Friends,

I am having problems with the following:

I have added a Login control to a web page. In the Login
control's Authenticate event, I am performing additional validation
against our database to make sure a user exists. If all goes well, I
set the e.Authenticated property equal to True. At the same time,
(while still in the Authenticate event), I retrieve a row from our
database which contains user specific information (Name, Address,
etc....). Here is where the problem lies:

In my Web.Config file, I have defined a profile which basically
looks like the information row retrieved. For each profile property,
I add the allowAnonymous=false attribute as I only want to allow
authenticated users onto my site with their specific profile loaded
from our database. When I try to assign the properties from my
database row to the profile (Profile.FirstName =
CurrentUserNameField), I receive an error stating that I am still
anonymous and that I cannot assign properties to profile that does not
allow for anonymous users. I can use the above code in any other page
and it will work correctly, but from within the Login control's
Authenticate, and LoggedIn events, I seem to be still anonymous
although I am not. Its almost like I have to leave those events for
Profile property assignment. Can anyone please help me?

Regards,

Giovanni

May 14 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: DC Gringo | last post by:
I recently added a machine with Visual Studio.NET 2003 on a Win2k sp4 SERVER machine and am having problems with roaming profiles. Apparently the Machine Debug Manager (mdm.exe) service is holding...
0
by: Miguel Dias Moura | last post by:
Hello, I am saving a complex type in Asp.Net 2.0 profile. I am using an SQL 2005 database as a profile provider. I have been consulting MSDN as help to create my class. (Please, see my code...
0
by: Bruno Alexandre | last post by:
Hi Guys, My Hosting company does not support SQL2005 so I need to use Access MDB File or SQL2000, and I'm having problems set this up under web.config I'm using:...
5
by: ashleyday56 | last post by:
Here is a very general idea, im expecting it to be useless or already thought of/dismissed by the time you have even read it as we cant create technology fast enough apparently?? Anyway... i...
2
by: Peter Afonin | last post by:
Hello, I'm using CreateUserWizard control in ASP.NET 2.0. I'm storing the data in SQL Server 2005. The first and last steps run smoothly without any problems. But I added one middle step to...
9
by: Eric Falsken | last post by:
I've added a number of additional properties to my profile. Sometimes, the values are populated when the user is retrieved from the database, but sometimes the values are empty/default. How can I...
1
by: shapper | last post by:
Hello, I have the following class to be used in profile: <Serializable()_ Public Class Options Inherits ProfileBase Private _Newsletter As Boolean Public Property Newsletter() As Boolean
9
by: Kirk | last post by:
I have successfully, implemented a custom Membership Provider to a SQL 2000 table, however, I am having problems doing the same with a Profile Provider. As I understand it, the steps for both of...
1
by: ruthie | last post by:
Hi, Becuase I use Web Application Project and not Web Site - the only way I can use the Profile is by installing "Web Profile Generator". So I reconsider using the Profile (my project is Ajax...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.