stevet26
Programmer
- Feb 9, 2005
- 53
Hi
I have setup a createuserwizard for my site. the actual login creation form come right at the end of the wizard because I need to take payment information beofre I can create the account.
Due to the fact I have to take information to make a payment before I create the user account, this means that I already have the users email address before I reach to create user form of the wizard.
Now save them having to re enter their email address in again I would like to use the email address I have taken earlier in the wizard. However I am finding it very difficult to access the email textbox in the create user form.
To try an beat this I have created a custom template for the create user form. Thinking that the textbox would get picked up if it is physically entered on to the aspx page. However this does not seem to work either.
Does anyone know if there is a way of solving my problem.
Please find the code I use for the CreateUserWizardStep below:
<code>
<asp:CreateUserWizardStep ID="wzdCreateUser" Title="Member Login Details" runat="server" OnActivate="wzdCreateUser_OnActivate">
<ContentTemplate>
<asp:ObjectDataSource ID="odsSecurityQuestion" runat="server" SelectMethod="GetSecurityQuestions" TypeName="MI.Website.Helpers"/>
<ol>
<li>
<asp:Label ID="lblUsername" runat="server" AssociatedControlID="UserName">UserID:</asp:Label><asp:TextBox runat="Server" ID="UserName" />
<asp:RequiredFieldValidator runat="server" ID="reqUsername" ControlToValidate="UserName" ErrorMessage="You need to enter a username" Text="*" />
</li>
<li>
<asp:Label ID="lblPassword" runat="server" AssociatedControlID="Password">Password:</asp:Label><asp:TextBox runat="Server" ID="Password" />
<asp:RequiredFieldValidator runat="server" ID="reqPassword" ControlToValidate="Password" ErrorMessage="You need to enter a Password" Text="*" />
</li>
<li>
<asp:Label ID="lblConfirmPassword" runat="server" AssociatedControlID="ConfirmPassword">Re-Type Password:</asp:Label><asp:TextBox runat="Server" ID="ConfirmPassword" />
<asp:CompareValidator runat="server" ID="compPassword" ControlToValidate="ConfirmPassword" ControlToCompare="Password" ErrorMessage="Password must match" Text="*" />
</li>
<li>
<asp:Label ID="lblEmail" runat="server" AssociatedControlID="Email">Email:</asp:Label><asp:TextBox runat="Server" ID="Email" />
</li>
<li>
<asp:Label ID="lblQuestion" runat="server" AssociatedControlID="Question">Security Question:</asp:Label>
<aspropDownList ID="Question" runat="server" DataSourceID="odsSecurityQuestion">
</aspropDownList>
</li>
<li>
<asp:Label ID="lblAnswer" runat="server" AssociatedControlID="Answer">Security Answer:</asp:Label><asp:TextBox runat="Server" ID="Answer" />
<asp:RequiredFieldValidator runat="server" ID="reqAnswer" ControlToValidate="Answer" ErrorMessage="You need to enter a Security Answer" Text="*" />
</li>
</ol>
</ContentTemplate>
</asp:CreateUserWizardStep>
</code>
This is the code behind I have tried (but failed with):
<code>
protected void wzdCreateUser_OnActivate(object sender, EventArgs e)
{
TextBox Email = (TextBox)wzdCreateUser.FindControl("Email");
Email.Text = txtEmail.Text;
}
</code>
Thanking you in advance.
I have setup a createuserwizard for my site. the actual login creation form come right at the end of the wizard because I need to take payment information beofre I can create the account.
Due to the fact I have to take information to make a payment before I create the user account, this means that I already have the users email address before I reach to create user form of the wizard.
Now save them having to re enter their email address in again I would like to use the email address I have taken earlier in the wizard. However I am finding it very difficult to access the email textbox in the create user form.
To try an beat this I have created a custom template for the create user form. Thinking that the textbox would get picked up if it is physically entered on to the aspx page. However this does not seem to work either.
Does anyone know if there is a way of solving my problem.
Please find the code I use for the CreateUserWizardStep below:
<code>
<asp:CreateUserWizardStep ID="wzdCreateUser" Title="Member Login Details" runat="server" OnActivate="wzdCreateUser_OnActivate">
<ContentTemplate>
<asp:ObjectDataSource ID="odsSecurityQuestion" runat="server" SelectMethod="GetSecurityQuestions" TypeName="MI.Website.Helpers"/>
<ol>
<li>
<asp:Label ID="lblUsername" runat="server" AssociatedControlID="UserName">UserID:</asp:Label><asp:TextBox runat="Server" ID="UserName" />
<asp:RequiredFieldValidator runat="server" ID="reqUsername" ControlToValidate="UserName" ErrorMessage="You need to enter a username" Text="*" />
</li>
<li>
<asp:Label ID="lblPassword" runat="server" AssociatedControlID="Password">Password:</asp:Label><asp:TextBox runat="Server" ID="Password" />
<asp:RequiredFieldValidator runat="server" ID="reqPassword" ControlToValidate="Password" ErrorMessage="You need to enter a Password" Text="*" />
</li>
<li>
<asp:Label ID="lblConfirmPassword" runat="server" AssociatedControlID="ConfirmPassword">Re-Type Password:</asp:Label><asp:TextBox runat="Server" ID="ConfirmPassword" />
<asp:CompareValidator runat="server" ID="compPassword" ControlToValidate="ConfirmPassword" ControlToCompare="Password" ErrorMessage="Password must match" Text="*" />
</li>
<li>
<asp:Label ID="lblEmail" runat="server" AssociatedControlID="Email">Email:</asp:Label><asp:TextBox runat="Server" ID="Email" />
</li>
<li>
<asp:Label ID="lblQuestion" runat="server" AssociatedControlID="Question">Security Question:</asp:Label>
<aspropDownList ID="Question" runat="server" DataSourceID="odsSecurityQuestion">
</aspropDownList>
</li>
<li>
<asp:Label ID="lblAnswer" runat="server" AssociatedControlID="Answer">Security Answer:</asp:Label><asp:TextBox runat="Server" ID="Answer" />
<asp:RequiredFieldValidator runat="server" ID="reqAnswer" ControlToValidate="Answer" ErrorMessage="You need to enter a Security Answer" Text="*" />
</li>
</ol>
</ContentTemplate>
</asp:CreateUserWizardStep>
</code>
This is the code behind I have tried (but failed with):
<code>
protected void wzdCreateUser_OnActivate(object sender, EventArgs e)
{
TextBox Email = (TextBox)wzdCreateUser.FindControl("Email");
Email.Text = txtEmail.Text;
}
</code>
Thanking you in advance.