CutomValidator to validate email address ignoring space at the end in .NET

March 19, 2009 at 8:13 am (.NET, ASP.NET, Technical) (, , )

We have compare validator in .NET to Compare the value entered by the user in an input control with the value entered in another input control, or with a constant value. Click here explore more on CompareValidator.

I had a unique requirement to validate the Email address in the two controls ignoring space at the end. I explored more and found a solution using the CustomValidator. Click here explore more on CustomValidator.

I have mentioned the code below

Added the following CustomValidator in the page:

<asp:CustomValidator ID=”CompareEmailAddress” runat=”Server” ClientValidationFunction=”CompareEmailAddress” ErrorMessage=”*” EnableClientScript = “true” ></asp:CustomValidator>

Read the rest of this entry »

Permalink 1 Comment