Validating Create User Wizard



Hi there

I'm trying to make a web user control using the CreateUserWizard but
modified to add a Role during the creation process. Basically I have followed
the example given by Scott Guthrie at
http://weblogs.asp.net/scottgu/archive/2005/10/18/427754.aspx (the sample he
has provider instals and works on my devlopment machine).

The problem that I am having is that the validation controls dont appear to
work within the CreateUserWizard template and I am wondering whether there is
something about this that I am not aware of (I cant see anything obviously
wrong). The work just fine when deployed on a normal page.

Code is below just in case I have missed something obvious!

-----------------------------------------------------------------------------

<asp:CreateUserWizard ID="CreateUserWizard1" runat="server"
BackColor="#F7F6F3" BorderColor="#E6E2D8" BorderStyle="Solid"
BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em">
<WizardSteps>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1"
runat="server" Title="User Information">
<ContentTemplate>
<table width="320">
<tr>
<th colspan="2">Enter User Details</th>
</tr>
<tr>
<td>Username:</td>
<td><asp:TextBox ID="UserName" runat="server"
Width="150px" ></asp:TextBox>
<asp:RequiredFieldValidator id="rfvUsername"
runat="server"
ControlToValidate="Username"
Display="Dynamic"
ErrorMessage="Username is required"
ValidationGroup="CreateNewUser"
>*</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td>Password:</td>
<td><asp:TextBox ID="Password" runat="server"
TextMode="Password" Width="150px" ></asp:TextBox>
<asp:RequiredFieldValidator id="rfvPassword"
runat="server"
ControlToValidate="Password"
Display="Dynamic"
ErrorMessage="Password is required"
ValidationGroup="CreateNewUser"
>*</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td>Confirm Password:</td>
<td><asp:TextBox ID="ConfirmPassword" runat="server"
TextMode="Password" Width="150px" ></asp:TextBox>
<asp:RequiredFieldValidator
id="rfvConfirmPassword"
runat="server"
ControlToValidate="Password"
Display="None"
ErrorMessage="Confirmation of password is
required"
ValidationGroup="CreateNewUser"
>*</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td>Email:</td>
<td><asp:TextBox ID="Email" runat="server"
Width="150px" ></asp:TextBox>
<asp:RequiredFieldValidator id="rfvEmail"
runat="server"
ControlToValidate="Email"
Display="None"
ErrorMessage="Email is required"
ValidationGroup="CreateNewUser"
>*</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td>Security Question:</td>
<td><asp:TextBox ID="Question" runat="server"
Width="150px" ></asp:TextBox>
<asp:RequiredFieldValidator id="rfvQuestion"
runat="server"
ControlToValidate="Question"
Display="None"
ErrorMessage="Security question is required"
ValidationGroup="CreateNewUser"
>*</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td>Security Answer:</td>
<td><asp:TextBox ID="Answer" runat="server"
Width="150px" ></asp:TextBox>
<asp:RequiredFieldValidator id="rfvAnswer"
runat="server"
ControlToValidate="Answer"
Display="None"
ErrorMessage="Security answer is required"
ValidationGroup="CreateNewUser"
>*</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td colspan="2" style="color: red" align="center" >
<asp:Literal id="ErrorMessage" runat="server"
></asp:Literal></td>
</tr>
<tr>
<td colspan="2">
<asp:CompareValidator ID="cvPassword"
runat="server"
ControlToValidate="Password"
ControlToCompare="ConfirmPassword"
Display="None"
ErrorMessage="The password and confirmation
password must match"

ValidationGroup="CreateNewUser"></asp:CompareValidator>
<asp:ValidationSummary ID="vsCreateNewUser"
runat="server"
DisplayMode="BulletList"
Enabled="true"
ValidationGroup="CreateNewUser" /></td>
</tr>
</table>
</ContentTemplate>
</asp:CreateUserWizardStep>

-------------------------------------------------------------------------

There is more but this basically constitutes the first panel.

Any sugestions.

--
Regards

Martyn Fewtrell
.