In my registration form, there is field to enter emailid of member, i want to restrinct user, so that he would able to enter to only three domain name like gmail, hotmail, yahoo like this emailids. Is it possible..? pLease give me solution..
Hi KALEEM,
I have made one sample that full-fill your requirement.
HTML
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <table> <tr> <td> Email: </td> <td> <asp:TextBox runat="server" ID="txtEmail" /> <asp:RequiredFieldValidator ID="rfvEmail" runat="server" ControlToValidate="txtEmail" ErrorMessage="Required!" ValidationGroup="G1"></asp:RequiredFieldValidator> <asp:RegularExpressionValidator ErrorMessage="Invalid Email" ControlToValidate="txtEmail" runat="server" ValidationExpression="^[a-zA-Z0-9]+@(gmail|yahoo|hotmail)\.(com|in|co.in)$" ID="revEmail" ValidationGroup="G1" /> </td> </tr> </table> </div> </form> </body> </html>
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.