By using RegularExpression, we can set the maximum no of characters allowed in a TextBox control in ASP.Net.
<asp:TextBox ID="txtMaximumCharacters" runat="server" Height="105px"
TextMode="MultiLine" Width="342px"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="txtMaximumCharacters"
ErrorMessage="Only 500 characters are allowed."
ValidationExpression="[\s\S]{1,500}"></asp:RegularExpressionValidator>