Another dumb question about text boxes in a Web app...

  • Thread starter Thread starter Coleen
  • Start date Start date
C

Coleen

I have a multiline text box that I only want to allow the user to type 500
characters in. I set the maxlength to 500, but I can type more than 500
characters in it. Is there a way to set the max length programmatically?
TIA

Coleen
 
No, there is no way to set the max length
programmatically, the documentation says "This property is
only applicable when the TextMode property is set to
TextBoxMode.SingleLine or TextBoxMode.Password", see here:

http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/cpref/html/frlrfsystemwebuiwebcontrolstextboxclassmaxlen
gthtopic.asp

To get around this, you'll have to validate the max length
yourself using client-side scripting or alternatively, you
can validate server-side by using a custom validator.

Hope this helps
 
Back
Top