Regular expression to have combination of UpperCase and LowerCase Alphabets

Last Reply on Nov 18, 2013 03:06 AM By Mudassar

Posted on Nov 18, 2013 03:03 AM


I have to apply a validation to accept only combination of Upper and Lower case to textbox but not either complete lower or complete upper or anything else. 

I am using below code but it allows complete upper and complete lower. 

Please help to get this resolved. 



<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

<td>First Name:</td>
<td><asp:TextBox ID="txtFirstname" runat="server"></asp:TextBox></td>
<td><asp:RegularExpressionValidator ID="revFirstName" runat="server" 
ControlToValidate="txtFirstname" ValidationExpression="^[a-zA-Z]+$" 
ErrorMessage="Only combination of Upper and lower allowed" Display="Dynamic">
<asp:Button ID="cmdSubmit" runat="server" Text="Submit" />


You are viewing reply posted by: Mudassar on Nov 18, 2013 03:06 AM.