About the author

Vijay Kodali
E-mail me Send mail

Site Statistics

Site Meter

Recent comments

Authors

Disclaimer

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

© Copyright 2010

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 (3) | Post RSSRSS comment feed

Comments

Gurpreet India

Tuesday, March 02, 2010 2:44 PM

Gurpreet

its Working fine.

Thanks,
Gurpreet

Gilberto Hoffmeister United States

Saturday, August 28, 2010 9:32 AM

Gilberto Hoffmeister

this was a very entertaining read.  i enjoyed it very much!

stop smoking drugs United States

Sunday, August 29, 2010 8:51 AM

stop smoking drugs

Those who say that it is absolutely impossible for smokers to stop smoking are most likely also the people who are too lazy and settled on the habit to even make an effort to quit. They keep saying to others what they say to themselves, that it is really impossible.

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading