<div class="col-md-12">
<div class="col-md-4">
Comments<span style="color: Red;">*</span>
</div>
<div class="col-md-6">
<asp:TextBox ID="txtComments" runat="server" TextMode="MultiLine" ClientIDMode="Static">
</asp:TextBox>
<asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator3"
ControlToValidate="txtComments" ValidationExpression="^[\s\S]{0,100}$"
ErrorMessage="Please enter a maximum of 100 characters"
Display="Dynamic" ValidationGroup="valSubmit"></asp:RegularExpressionValidator>
</div>
</div>
In the above validation expression ValidationExpression="^[\s\S]{0,maxlength}$", the max-length that you define as per your database table is required. This validation is valid for this expression on the server side.
In the previous post, I discussed the JQuery function to Validate the MaxLength of TextMode="MultiLine" of the textbox.
No comments:
Post a Comment