<textarea name="txtComments" rows="2" cols="20" id="txtComments">
In contrast, a TextBox with its TextMode set to SingleLine is rendered as an <input> tag, which has the maxlength attribute:
<input name="txtComments" type="text" maxlength="5" id="txtComments" />
If you wish to restrict the amount of text in a MultiLine TextBox, the workaround is to use a RegularExpressionValidator control. In the following example, the validation expression allows between 0 and 5 alphanumeric characters to be entered:
string strMaxLength = "5";
revComments.ValidationExpression = "\\w{0," + strMaxLength + "}$";