Link to home
Start Free TrialLog in
Avatar of miyengar
miyengar

asked on

Textbox maxlength

I want to set the maxlength property of a textbox with the textmode as multiline.  How can i use the maxlength property to set my textbox in such a way it does not let the user to enter more than the maxlength property. Again it is a multiline textbox.

Avatar of Rodney Helsens
Rodney Helsens

Restricting length of the text in Multiline textbox is not supported in ASP.NET Web control, you can accomplish the maxlength property by using a RegularExpression Validator... check the link below.

taken from
http://www.extremeexperts.com/Net/tools/MultiLineTextBox.aspx
Avatar of miyengar

ASKER

I want to use custom validator to check the length.  Can someone help me with the code
ASKER CERTIFIED SOLUTION
Avatar of sachitjain
sachitjain
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The above code works fine but had a question on that:
5000  the max length is being hardcoded.  Instead of hard coding, in another textbox I want to enter maxlength which may vary each time and then use that value in my program rather than hardcoding 5000 as max length. Any solution on that. I appreciate ur help.