473,473 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1384
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.