Error on signup if e-mail exists
Posted: Fri Apr 03, 2009 7:52 am
We have had a couple of customers who have tried to create a new account, but their e-mail address is already in the system. Because of the adaptation of our sign in page, we are getting a runtime error instead of simply telling the customer that the e-mail address already exists. Here is our RegisterDialog.ascx file
Can anyone see where the problem is?
Code: Select all
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RegisterDialog.ascx.cs" Inherits="ConLib_RegisterDialog" %>
<%--
<conlib>
<summary>Display a form using that a new customer can register for a new account.</summary>
</conlib>
--%>
<div class="dialogSection">
<div class="header">
<h2><asp:Localize ID="Caption" runat="server" Text="New Customers"></asp:Localize></h2>
</div>
<div class="content nofooter">
<table class="inputForm" cellpadding="0" cellspacing="0" align="center">
<tr>
<td colspan="3">
<asp:Label ID="InstructionText" runat="server" EnableViewState="False" Text="If you are a new customer, take a moment to register below."></asp:Label>
<asp:ValidationSummary ID="RegisterValidationSummary" runat="server" ValidationGroup="Register" />
</td>
</tr>
<tr>
<td align="center" colspan="3">
<asp:Label ID="FailureText" runat="server" EnableViewState="False" SkinID="ErrorCondition"></asp:Label>
</td>
</tr>
<tr>
<th class="rowHeader">
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName" Text="Email:"></asp:Label>
</th>
<td align="left" colspan="2">
<asp:TextBox ID="UserName" runat="server" Columns="30"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
ErrorMessage="Email address is required" ToolTip="Email address is required"
ValidationGroup="Register" Display="Dynamic" Text="*"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="EmailValidator" runat="server" ControlToValidate="UserName"
ErrorMessage="Email address is not valid." ToolTip="Email address is not valid."
ValidationGroup="Register" Display="Dynamic" Text="*"></asp:RegularExpressionValidator>
<asp:CustomValidator ID="InvalidRegistration" runat="server" ControlToValidate="UserName"
ErrorMessage="Registration was not successful." ToolTip="Registration was not successful."
Display="Dynamic" ValidationGroup="Register" Text="*"></asp:CustomValidator>
</td>
</tr>
<tr>
<td> </td>
<td align="left" colspan="2">
<asp:CheckBox ID="RememberUserName" runat="server" Text="Remember Me" />
</td>
</tr>
<tr>
<th class="rowHeader">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password" Text="Password:"></asp:Label>
</th>
<td align="left">
<asp:TextBox ID="Password" runat="server" TextMode="Password" Width="80" MaxLength="24"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
ErrorMessage="You must provide a password" ToolTip="You must provide a password"
ValidationGroup="Register" Text="*"></asp:RequiredFieldValidator>
<asp:PlaceHolder ID="PasswordValidatorPanel" runat="server" EnableViewState="false"></asp:PlaceHolder>
</td>
<td rowspan="2" valign="top">
<div style="width:220px;text-align:justify">
<i><asp:Localize ID="PasswordPolicyLength" runat="server" Text="Your password must be at least {0} characters long."></asp:Localize>
<asp:Localize ID="PasswordPolicyRequired" runat="server" Text="You must include at least one {0}."></asp:Localize></i>
</div>
</td>
</tr>
<tr>
<th class="rowHeader">
<asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword" Text="Re-enter:"></asp:Label>
</th>
<td align="left">
<asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password" Width="80" MaxLength="24"></asp:TextBox>
<asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword"
ErrorMessage="You must re-enter the password." ToolTip="You must re-enter the password."
ValidationGroup="Register" Text="*"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="You did not re-enter the password correctly."
ValidationGroup="Register" Text="*"></asp:CompareValidator>
</td>
</tr>
<tr>
<td> </td>
<td colspan="2">
<asp:Button ID="RegisterButton" runat="server" Text="Register" OnClick="RegisterButton_Click" ValidationGroup="Register" />
</td>
</tr>
</table>
</div>
</div>