How to validate only characters along-with space will be allowed in Textbox?

 Posted by Rajesh_Kumar on 1/21/2014 | Category: ASP.NET Interview questions | Views: 2718 | Points: 40
Answer:

<asp:TextBox runat="server" Id="txt_first_name" />


<asp:RegularExpressionValidator runat="server" id="rex_first_name" ControlToValidate="txt_first_name" ValidationExpression="^[a-zA-Z ]$" ErrorMessage="Only Characters and Space Allowed" />


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response