Archives

Archives / 2007 / August
  • Limiting the length of a multiline textbox

    Limiting the length of an ASP.net mulitline textbox control is easy. Add a RegularExpressionValidator, set the ControlToValidateProperty to the ID of the TextBox you wish to validate and set the ValidationExpression property to :

    ^[\s\S]{0,300}$