About the author

Vijay Kodali
E-mail me Send mail

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2024

Multiline Asp.Net textbox maxlength

MaxLength property of a TextBox control does not work when the TextMode property is set to Multiline. Here is small work around using regualr expression validator..

<asp:TextBox ID="txtComment" runat="server" Width="466px" TextMode ="MultiLine" ></asp:TextBox> 
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtComment" 
ErrorMessage="Not more than 50 charcters" Display="Static" ValidationExpression='^[\s\S]{0,50}$'> 
</asp:RegularExpressionValidator> 

Tags:
Categories: ASP.NET
Posted by vijay on Wednesday, November 21, 2007 3:02 PM
Permalink | Comments (1) | Post RSSRSS comment feed

Comments

Gurpreet India

Tuesday, March 2, 2010 2:44 PM

Gurpreet

its Working fine.

Thanks,
Gurpreet

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading