i want to validate the email address, when the users enter the email id in the text box, it validates at run time that the entered email is correct....or not??
how can i do this..??
How to validate the E-mail ID....???
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Suthish NairRank #92 · 22.8K reputationPosted Sep 30, 2010, 10:11 PM EDT
asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" EnableViewState="False" Display="Static" ControlToValidate="TextBoxEmailId" ErrorMessage="Email must not be empty" SetFocusOnError="True"/>asp:RegularExpressionValidator ID="RegularExpressionValidator1" Display="Static" runat="server" EnableViewState="False" ErrorMessage="Invalid Email" ControlToValidate="TextBoxEmailId" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" SetFocusOnError="True"/>or javascript way..
function ValidateForm() { if (document.getElementById('').value == "") { alert("Please provide Email ID !"); document.getElementById('').focus(); return false; } else { if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('').value))) { alert("The EmailId entered is not a valid Email Address. !"); document.getElementById('').focus(); return false; } } }On Page Load
Button1.Attributes.Add("onclick", "javascript:return ValidateForm();")