![]() |
|
|
#1 |
|
Guest
Posts: n/a
|
Creating a profile
I am trying to create a profile for logged on user JohnDoe.
I have a form with, for example, a textbox for entering the FirstName. The textbox has an ID of "txtbxFirstName" and in the web.config file I have: <profile> <properties> <add name="FirstName" type="String" serializeAs="String" defaultValue="Insert your data" /> </properties> </profile> So I think everything is set up to use the default membership provider. When logged in user JohnDoe fills out the texbbos and clicks the submit button on the form, I run the subroutine: Profile.FirstName = txtbxFirstName.Text This results in an entry into the aspnet_Profile table as it should, but the problem I am having is that it creates a new UserID in that table that is different from JohnDoe's UserID. So that profile does not seem to be associated with him. In the database, I have the UserID (primary key of the aspnet_Profiles) table linked to the UserID (primary key of the aspnet_Users) table. Anyone have an idea what is wrong here? Am I missing some step needed to ensure that the data submitted is tied to the logged on users UserID? -- Clark CHO, HomePage Doctor http://www.homepagedoctor.com/Expres.../Tutorials.htm ------------------------------------------------------------------------------------------------- |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Re: Creating a profile
I don't know if anyone is watching this, but in case, I did find the answer
from some interactions on the asp.net forum. Things were actually working but looked like they were not. The problem was that the UserID column in the aspnet_Profiles table only shows the last 16 characters of the UserID. Even if the column width is set plenty wide so there is room for the entire UserID. So when I compared the first 3 or 4 letters of that UserID with the UserID of the aspnet_Users table, of course they did not agree. Only after you click some other field in the Profiles table and then click back into the UserID field, then presto! The whole UserID appears. Dumb dumb dumb why would they ever design the table so it doesnt show the entire UserID by default. I blame Microsoft for 10 hours or more of wasted energy! But the good news is that now I'm on to the next nut to crack. -- Clark CHO, HomePage Doctor http://www.homepagedoctor.com/Expres.../Tutorials.htm ------------------------------------------------------------------------------------------------- "Clark" <nonworking@nowhwere.com> wrote in message news:e3VP0z60IHA.416@TK2MSFTNGP04.phx.gbl... >I am trying to create a profile for logged on user JohnDoe. > > I have a form with, for example, a textbox for entering the FirstName. > The textbox has an ID of "txtbxFirstName" and in the web.config file I > have: > > <profile> > <properties> > > <add name="FirstName" type="String" serializeAs="String" > defaultValue="Insert your data" /> > > > > </properties> > > </profile> > > So I think everything is set up to use the default membership provider. > > When logged in user JohnDoe fills out the texbbos and clicks the submit > button on the form, I run the subroutine: > > Profile.FirstName = txtbxFirstName.Text > > This results in an entry into the aspnet_Profile table as it should, but > the problem I am having is that it creates a new UserID in that table that > is different from JohnDoe's UserID. So that profile does not seem to be > associated with him. > > In the database, I have the UserID (primary key of the aspnet_Profiles) > table linked to the UserID (primary key of the aspnet_Users) table. > > Anyone have an idea what is wrong here? Am I missing some step needed to > ensure that the data submitted is tied to the logged on users UserID? > > -- > Clark > CHO, HomePage Doctor > http://www.homepagedoctor.com/Expres.../Tutorials.htm > ------------------------------------------------------------------------------------------------- > > |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|