Take wizard out of register.aspx

Topics: Developer Discussion, Help, Request
Apr 17, 2007 at 2:27 AM
Since I cannot get step 2 of the create user form to validate, could someone help me take the wizard out of register.aspx, I think the validation will work then. Thank you.
Coordinator
Apr 17, 2007 at 9:55 PM
Can you explain the "validation" errors... maybe with a screenshot. It might just be that you aren't adding a ValidationGroup property.
Apr 18, 2007 at 4:44 AM

z2bass wrote:
Can you explain the "validation" errors... maybe with a screenshot. It might just be that you aren't adding a ValidationGroup property.


There is no error, the problem is a user can leave the member details blank and still complete the user account creation. The wizard right out of the box does this, the validation controls on first name and last name do not work. Check the web sites listed on the home page that were created with 2.0, create a user account and leave step 2 blank, the form completes without stopping for the validation controls.
Apr 19, 2007 at 2:19 PM

jerrysdean43 wrote:

z2bass wrote:
Can you explain the "validation" errors... maybe with a screenshot. It might just be that you aren't adding a ValidationGroup property.


There is no error, the problem is a user can leave the member details blank and still complete the user account creation. The wizard right out of the box does this, the validation controls on first name and last name do not work. Check the web sites listed on the home page that were created with 2.0, create a user account and leave step 2 blank, the form completes without stopping for the validation controls.


Here is the code for the wizard, am I missing something? Thanks

<asp:UpdatePanel id="UpdatePanel1" runat="server">
<contenttemplate>
<asp:CreateUserWizard id="CreateUserWizard1" runat="server" DisableCreatedUser="True" OnFinishButtonClick="CreateUserFinished" FinishDestinationPageUrl="~/Default.aspx"><WizardSteps>
<asp:CreateUserWizardStep runat="server"><ContentTemplate>
<table border="0">
<tr>
<td align="center" colspan="2">
Sign Up for Your New Account</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label></td>
<td>
<asp:TextBox ID="UserName" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label></td>
<td>
<asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label></td>
<td>
<asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword"
ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required."
ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label></td>
<td>
<asp:TextBox ID="Email" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
ErrorMessage="E-mail is required." ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Security Question:</asp:Label></td>
<td>
<asp:TextBox ID="Question" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question"
ErrorMessage="Security question is required." ToolTip="Security question is required."
ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Security Answer:</asp:Label></td>
<td>
<asp:TextBox ID="Answer" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer"
ErrorMessage="Security answer is required." ToolTip="Security answer is required."
ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2" style="color: red">
<asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
</td>
</tr>
</table>
</ContentTemplate>
</asp:CreateUserWizardStep>
<asp:WizardStep runat="server" Title="Contact details"><TABLE><TBODY><TR><TD class="formlabel"><LABEL for="fname">First Name:</LABEL> </TD><TD class="formvalue" style="width: 2601px"><asp:TextBox runat="server" CssClass="txtfield" ID="fname"></asp:TextBox>
<asp:RequiredFieldValidator runat="server" ErrorMessage="First Name is required." ToolTip="First Name is required." ControlToValidate="fname" ID="fnamerequired" ValidationGroup="CreateUserForm">*</asp:RequiredFieldValidator>
</TD></TR><TR><TD class="formlabel"><LABEL for="lname">Last Name:</LABEL> </TD><TD class="formvalue" style="width: 2601px"><asp:TextBox runat="server" CssClass="txtfield" ID="lname"></asp:TextBox>
<asp:RequiredFieldValidator runat="server" ErrorMessage="Last Name is required." ToolTip="Last Name is required." ControlToValidate="lname" ID="lnamerequired" ValidationGroup="CreateUserForm">*</asp:RequiredFieldValidator>
</TD></TR><TR><TD class="formlabel"><LABEL for="Addr">Address:</LABEL> </TD><TD class="formvalue" style="width: 2601px"><asp:TextBox runat="server" Rows="3" CssClass="txtblock" ID="Addr" TextMode="MultiLine"></asp:TextBox>
</TD></TR><TR><TD class="formlabel"><LABEL for="Phone">Phone:</LABEL> </TD><TD class="formvalue" style="width: 2601px"><asp:TextBox runat="server" CssClass="txtfield" ID="Phone"></asp:TextBox>
</TD></TR>
<tr>
<td class="formlabel">
SAHC Membership number</td>
<td class="formvalue" style="width: 2601px">
<asp:TextBox ID="Memnum" runat="server"></asp:TextBox>
 
Apr 19, 2007 at 5:20 PM

jerrysdean43 wrote:

jerrysdean43 wrote:

z2bass wrote:
Can you explain the "validation" errors... maybe with a screenshot. It might just be that you aren't adding a ValidationGroup property.


I think there is some kind of issue with the validation inside a wizard, some code needed that would prevent the wizard completing the finish step without the required field validation.
There is no error, the problem is a user can leave the member details blank and still complete the user account creation. The wizard right out of the box does this, the validation controls on first name and last name do not work. Check the web sites listed on the home page that were created with 2.0, create a user account and leave step 2 blank, the form completes without stopping for the validation controls.


Here is the code for the wizard, am I missing something? Thanks

<asp:UpdatePanel id="UpdatePanel1" runat="server">
<contenttemplate>
<asp:CreateUserWizard id="CreateUserWizard1" runat="server" DisableCreatedUser="True" OnFinishButtonClick="CreateUserFinished" FinishDestinationPageUrl="~/Default.aspx"><WizardSteps>
<asp:CreateUserWizardStep runat="server"><ContentTemplate>
<table border="0">
<tr>
<td align="center" colspan="2">
Sign Up for Your New Account</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label></td>
<td>
<asp:TextBox ID="UserName" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label></td>
<td>
<asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label></td>
<td>
<asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword"
ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required."
ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label></td>
<td>
<asp:TextBox ID="Email" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
ErrorMessage="E-mail is required." ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Security Question:</asp:Label></td>
<td>
<asp:TextBox ID="Question" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question"
ErrorMessage="Security question is required." ToolTip="Security question is required."
ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Security Answer:</asp:Label></td>
<td>
<asp:TextBox ID="Answer" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer"
ErrorMessage="Security answer is required." ToolTip="Security answer is required."
ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2" style="color: red">
<asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
</td>
</tr>
</table>
</ContentTemplate>
</asp:CreateUserWizardStep>
<asp:WizardStep runat="server" Title="Contact details"><TABLE><TBODY><TR><TD class="formlabel"><LABEL for="fname">First Name:</LABEL> </TD><TD class="formvalue" style="width: 2601px"><asp:TextBox runat="server" CssClass="txtfield" ID="fname"></asp:TextBox>
<asp:RequiredFieldValidator runat="server" ErrorMessage="First Name is required." ToolTip="First Name is required." ControlToValidate="fname" ID="fnamerequired" ValidationGroup="CreateUserForm">*</asp:RequiredFieldValidator>
</TD></TR><TR><TD class="formlabel"><LABEL for="lname">Last Name:</LABEL> </TD><TD class="formvalue" style="width: 2601px"><asp:TextBox runat="server" CssClass="txtfield" ID="lname"></asp:TextBox>
<asp:RequiredFieldValidator runat="server" ErrorMessage="Last Name is required." ToolTip="Last Name is required." ControlToValidate="lname" ID="lnamerequired" ValidationGroup="CreateUserForm">*</asp:RequiredFieldValidator>
</TD></TR><TR><TD class="formlabel"><LABEL for="Addr">Address:</LABEL> </TD><TD class="formvalue" style="width: 2601px"><asp:TextBox runat="server" Rows="3" CssClass="txtblock" ID="Addr" TextMode="MultiLine"></asp:TextBox>
</TD></TR><TR><TD class="formlabel"><LABEL for="Phone">Phone:</LABEL> </TD><TD class="formvalue" style="width: 2601px"><asp:TextBox runat="server" CssClass="txtfield" ID="Phone"></asp:TextBox>
</TD></TR>
<tr>
<td class="formlabel">
SAHC Membership number</td>
<td class="formvalue" style="width: 2601px">
<asp:TextBox ID="Memnum" runat="server"></asp:TextBox>
 
Coordinator
Apr 21, 2007 at 5:01 PM
Heres what I see...
DisableCreatedUser="True" should be set to false

You are missing the value for the default wizard step. Open the designer and open the first step.
Apr 22, 2007 at 6:29 PM

z2bass wrote:
Heres what I see...
DisableCreatedUser="True" should be set to false

You are missing the value for the default wizard step. Open the designer and open the first step.


Thank you, I changed the above to false, not sure what how to open the designer and open the first step means, I opened the wizard and the first step is open. Is there still something I need to do, it still completes without anything filled in in the member details. Does it need page.isvalid isvalid istrue somewhere in the wizard?
Apr 22, 2007 at 6:54 PM

z2bass wrote:
Heres what I see...
DisableCreatedUser="True" should be set to false

You are missing the value for the default wizard step. Open the designer and open the first step.


Likr this?
<asp:CreateUserWizard id="CreateUserWizard1" runat="server" DisableCreatedUser="False" OnFinishButtonClick="CreateUserFinished" FinishDestinationPageUrl="~/Default.aspx"><WizardSteps>
<asp:CreateUserWizardStep runat="server"><ContentTemplate>
Coordinator
Apr 22, 2007 at 10:48 PM

jerrysdean43 wrote:

z2bass wrote:
Heres what I see...
DisableCreatedUser="True" should be set to false

You are missing the value for the default wizard step. Open the designer and open the first step.


What exactly is wrong... it should work out of the box. By validation, do you mean the validator controls aren't working or do you mean that the user info is not added?
Likr this?
<asp:CreateUserWizard id="CreateUserWizard1" runat="server" DisableCreatedUser="False" OnFinishButtonClick="CreateUserFinished" FinishDestinationPageUrl="~/Default.aspx"><WizardSteps>
<asp:CreateUserWizardStep runat="server"><ContentTemplate>

Apr 22, 2007 at 11:36 PM
Edited Apr 22, 2007 at 11:39 PM

z2bass wrote:

jerrysdean43 wrote:

z2bass wrote:
Heres what I see...
DisableCreatedUser="True" should be set to false

You are missing the value for the default wizard step. Open the designer and open the first step.


What exactly is wrong... it should work out of the box. By validation, do you mean the validator controls aren't working or do you mean that the user info is not added?
Likr this?
<asp:CreateUserWizard id="CreateUserWizard1" runat="server" DisableCreatedUser="False" OnFinishButtonClick="CreateUserFinished" FinishDestinationPageUrl="~/Default.aspx"><WizardSteps>
<asp:CreateUserWizardStep runat="server"><ContentTemplate>


The validator controls are not working, they do not work on any of the three sites that are listed on your home page at the bottom either. If the member details are left blank the form still adds the user account. This is the link on my site: http://sahcinfo.org/member/register.aspx Fill in step 1 and leave the fields blank in step 2, the form still completes without the validation required fields working.
Coordinator
Apr 23, 2007 at 1:21 AM

jerrysdean43 wrote:

z2bass wrote:

jerrysdean43 wrote:

z2bass wrote:
Heres what I see...
DisableCreatedUser="True" should be set to false

You are missing the value for the default wizard step. Open the designer and open the first step.


What exactly is wrong... it should work out of the box. By validation, do you mean the validator controls aren't working or do you mean that the user info is not added?
Likr this?
<asp:CreateUserWizard id="CreateUserWizard1" runat="server" DisableCreatedUser="False" OnFinishButtonClick="CreateUserFinished" FinishDestinationPageUrl="~/Default.aspx"><WizardSteps>
<asp:CreateUserWizardStep runat="server"><ContentTemplate>


The validator controls are not working, they do not work on any of the three sites that are listed on your home page at the bottom either. If the member details are left blank the form still adds the user account. This is the link on my site: http://sahcinfo.org/member/register.aspx Fill in step 1 and leave the fields blank in step 2, the form still completes without the validation required fields working.


OHHH... I see. This is by design... whenever the user goes past the first step the user is created. This is the default behavior in the Membership provider. It might be possible to have the user created after the 2nd step. That would requre adding some code against the Membership provider. I don't think this is an issue... the user just needs to follow instructions.
Apr 23, 2007 at 2:28 PM

z2bass wrote:

jerrysdean43 wrote:

z2bass wrote:

jerrysdean43 wrote:

z2bass wrote:
Heres what I see...
DisableCreatedUser="True" should be set to false

You are missing the value for the default wizard step. Open the designer and open the first step.


What exactly is wrong... it should work out of the box. By validation, do you mean the validator controls aren't working or do you mean that the user info is not added?
Likr this?
<asp:CreateUserWizard id="CreateUserWizard1" runat="server" DisableCreatedUser="False" OnFinishButtonClick="CreateUserFinished" FinishDestinationPageUrl="~/Default.aspx"><WizardSteps>
<asp:CreateUserWizardStep runat="server"><ContentTemplate>


The validator controls are not working, they do not work on any of the three sites that are listed on your home page at the bottom either. If the member details are left blank the form still adds the user account. This is the link on my site: http://sahcinfo.org/member/register.aspx Fill in step 1 and leave the fields blank in step 2, the form still completes without the validation required fields working.


OHHH... I see. This is by design... whenever the user goes past the first step the user is created. This is the default behavior in the Membership provider. It might be possible to have the user created after the 2nd step. That would requre adding some code against the Membership provider. I don't think this is an issue... the user just needs to follow instructions.


Thanks for your reply, it is a problem for me as many are leaving the 2nd step blank and I am missing info. I really need the memnum field, I guess I could put it in the first step. Is there any way that step 1 and step 2 could be merged into 1 step? That would fix my problem.