Last post Aug 12, 2015 02:35 AM by Nan Yu
Aug 11, 2015 10:13 AM|B9678123|LINK
how to add value in comment field of aspnet_Membership table
Aug 11, 2015 10:20 AM|sandnepal|LINK
Can you please specify the about the comment field? Are you been using using xml comment style ?
Aug 11, 2015 10:30 AM|B9678123|LINK
using below code to create the user
<asp:CreateUserWizard ID="RegisterUser" runat="server" EnableViewState="false" OnCreatedUser="RegisterUser_CreatedUser"
AutoGeneratePassword="False" CssClass="Button1" DisplayCancelButton="False" LoginCreatedUser="False">
Below is the codebehind
protected void RegisterUser_CreatedUser(object sender, EventArgs e)
// FormsAuthentication.SetAuthCookie(RegisterUser.UserName, false /* createPersistentCookie */);
TextBox textBoxComments = (TextBox)RegisterUserWizardStep.ContentTemplateContainer.FindControl("TBDesc");
CreateUserWizard cuw = (CreateUserWizard)sender;
MembershipUser user = Membership.GetUser(cuw.UserName);
user.Comment = textBoxComments.Text;
There is one column in aspnet_Membership table name Comment. I want to insert some comment in it using
user.Comment as mentioned in above code but it is not working.
Aug 12, 2015 01:28 AM|B9678123|LINK
Just add this line and it works fine
Aug 12, 2015 02:35 AM|Nan Yu|LINK
Hi B9678123 ,
Happy to hear you have solved your problem and show us the solution . Yes , you need to update your user info , when we call GetUser
UpdateUser from our code, the provider connects to the specified database and runs a stored procedure that gets information
about the requested user or updates the specified user's account.
You could also refer to links below for more information about ASP.NET's Membership: