I have a textarea in C#, please see below code:
<asp:Label ID="lblQuestions" runat="server" CssClass="addinfo">
Question & Comments</asp:Label>
<asp:TextBox ID="txtQuestions" Rows="5" Columns="5" TextMode="MultiLine" runat="server" MaxLength="250"></asp:TextBox>
Now I want that textarea should not accept more than 250 characters, whatever user do COPY & PASTE, by WRITING and DRAG & DROP etc, if user try to copy or drag & drop more than 250 character the first 250 characters should be copied in textarea. I know that there no MAXLENGTH attribute in TEXTAREA. If it is not possible with .NET the solution with javascript or Jquery will work.
Please help
You have to wire functions for the events
onpaste, onkeyup and onfocus of the area for which you want to do this action.
For an asp textbox I think you have to consider only OnTextChanged event.
For textarea
The countfield textbox is for showing remaining characters.