Adding additional fields to the login feature in asp.net
I have a application that i am creating in ASP.net i need to be 开发者_StackOverflow中文版able to update a new column in the table users which is set up automatic with a asp.net project. I am trying to add a address line to the code
This is code that i have so far
TextBox address1TextBox =
(TextBox)RegisterUserWizardStep.ContentTemplateContainer.FindControl("Address1TextBox");
TextBox userNameTextBox =
(TextBox)RegisterUserWizardStep.ContentTemplateContainer.FindControl("UserName");
Profile.
Membership.UpdateUser(user);
Any one have any ideas of how i would even update this column in the user table that i have.
Any ideas of how i could update the address line1 table in the database that comes with a visual studio 2010 project.
The easiest way is to store in the profile the additional fields you need or store these additional fields in a database table, and link the two tables together, the asp.net user table and your table or profile. There is an extra key field in the membership table called MembershipObjectKey or something like that, that is a generic field that allows you to store the key of the record in your user table, so you can use that to link the two.
HTH.
精彩评论