You can achieve this in few steps.
Create a new field Mobile in table aspnet_Users table.
Convert your createUserWizard to template.
I am removing much of the code for keeping it short and nice. Notice how Mobile filed is included in wizard. Code:
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server"
CreateUserButtonText="Sign Up"
oncreateduser="CreateUserWizard1_CreatedUser" >
<WizardSteps>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1" Title="CreateUser" runat="server">
<ContentTemplate>
<table border="0" style="background:gray" id="TABLE2">
<tr>
<td align="center" colspan="2">
Sign Up for Your New Account</td>
</tr>
<tr>
<td align="right" class="style4">
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User
Name:</asp:Label>
</td>
<td>
<asp:TextBox ID="UserName" runat="server"> </asp:TextBox>
</td>
</tr>
Your Mobile No: Enter Mobile No
- In code behind add namespace System.Data.SqlClient ;
and below page_load event use this code
Code:
protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
{
if (CreateUserWizard1.ActiveStep.Title == "CreateUser")
{
TextBox mobile = (TextBox)CreateUserWizardStep1.ContentTemplateContainer.FindControl("Mob");
string connectionString = ConfigurationManager.ConnectionStrings["LocalSqlServer"].ConnectionString;
string insertSql = "INSERT INTO aspnet_Users(Mobile) VALUES(@AddMob)";
using (SqlConnection myConnection = new SqlConnection(connectionString))
{
myConnection.Open();
SqlCommand myCommand = new SqlCommand(insertSql, myConnection);
myCommand.Parameters.AddWithValue("@AddMob", mobile.Text);
myCommand.ExecuteNonQuery();
myConnection.Close();
}
}
}
Hope this helps...