In this post, I am going to show you the simple JQuery code for counting the Text/Character that is entered in the TextBox. And after reaching the limit it will stop the user to enter any Text.
In the <head> tag:-
<head runat="server">
<title>TextCounter</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
In the <form> tag:-
<form id="form1" runat="server">
<div>
<h2>Message :</h2>
<asp:TextBox ID="txtMessage" Height="150px" Width="250px" TextMode="MultiLine" onkeyup="textCount(this)" runat="server" />
(<asp:Label ID="lblCountmsg" ForeColor="#0066ff" Text="150" runat="server" />/150)
</div>
</form>