title: Check for duplicate entry validation
body: <p>I have asked a similar question to this on here using MySQL, PHP and jQuery but I am now implementing a site in C#.NET and am using the built in ASP.NET Validation.</p>
  
  <p>In my user registration, I want to validate (using ajax, not after the form submit) that the users email is unique, i.e. I want to perform a sql query to see if there is a resulting row with what the user has typed into the email field. From what I have read, there is not a good way to combine jQuery validation and the asp.net validation so I need a way to do this through ASP.NET.</p>
  
  <p>I am NOT using the built in Membership framework.</p>
  
  <p>Here is the part of my form dealing with email</p>
  
  <pre><code>&lt;%--email and confirm email--%&gt;
                              &lt;tr&gt;
  
                                  &lt;td&gt;
                                      &lt;ajaxToolkit:TextBoxWatermarkExtender ID="WatermarkEmail" runat="server" TargetControlID="Email" WatermarkText="Email" WatermarkCssClass="watermarked roundedcorner" /&gt;
                                      &lt;asp:TextBox ID="Email" runat="server" Columns="48" CssClass="roundedcorner"&gt;&lt;/asp:TextBox&gt;
                                      &lt;asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email" ErrorMessage="E-mail is required." ToolTip="E-mail is required." ValidationGroup="UserInformation"&gt;&lt;font color="red"&gt;*&lt;/font&gt;&lt;/asp:RequiredFieldValidator&gt;
                                      &lt;asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ForeColor="Red" ControlToValidate="Email" ValidationGroup="UserInformation" ErrorMessage="Invalid Email Format"&gt;&lt;/asp:RegularExpressionValidator&gt;
                                  &lt;/td&gt;
                              &lt;/tr&gt;
                              &lt;tr&gt;
                                  &lt;td&gt;
                                      &lt;ajaxToolkit:TextBoxWatermarkExtender ID="WatermarkConfirmEmail" runat="server" TargetControlID="ConfirmEmail" WatermarkText="Confirm Email" WatermarkCssClass="watermarked roundedcorner" /&gt;
                                      &lt;asp:TextBox ID="ConfirmEmail" runat="server" Columns="48" CssClass="roundedcorner"&gt;&lt;/asp:TextBox&gt;
                                      &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ConfirmEmail" ErrorMessage="Confirm E-mail is required." ToolTip="Confirm E-mail is required." ValidationGroup="UserInformation"&gt;&lt;font color="red"&gt;*&lt;/font&gt;&lt;/asp:RequiredFieldValidator&gt;
                                      &lt;asp:RegularExpressionValidator ID="regexEmailValid" runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ForeColor="red" ControlToValidate="ConfirmEmail" ValidationGroup="UserInformation" ErrorMessage="Invalid Email Format"&gt;&lt;/asp:RegularExpressionValidator&gt;
  
                                  &lt;/td&gt;
                              &lt;/tr&gt;
  </code></pre>
  
  <p>is there any way i can implement a <code>&lt;asp:CustomValidator /&gt;</code> into the email field that will provide the functionality I described? Or will it have to be a bit more complicated....</p>