Beginner Beginner - 1 month ago 16
ASP.NET (C#) Question

asp text box limit number of characters?

<asp:TextBox ID="txtBodySMS" runat="server" Rows="10"
TextMode="MultiLine" Width="100%"></asp:TextBox>


This is my text box. how do i limit the number of characters a user can type inside it?

Answer
<asp:TextBox ID="txtBodySMS" runat="server" Rows="10" MaxLength="2"  
                                     Width="100%"></asp:TextBox>