I want to set MaxLength property of a textbox with multiline in asp.net(for example 100 character). I do not want to use javascript solution. I have used :
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1" SetFocusOnError="true" ValidationExpression="^[a-zA-Z.]{0,100}$"></asp:RegularExpressionValidator>
<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Height="109px" Width="274px" ></asp:TextBox>
</div>
</form>
</body>
</html>
and this :
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:RegularExpressionValidator ID="rgConclusionValidator2" ControlToValidate="TextBox1" ValidationExpression="^[\s\S]{0,100}$" runat="server" SetFocusOnError="true" /></asp:RegularExpressionValidator>
<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Height="109px" Width="274px" ></asp:TextBox>
</div>
</form>
</body>
</html>
but none of them works. i have test on latest ie, firefox , chrome , opera. thanks alot.