How to limit characters in textbox in asp.net

{0 Comments}

In your application if, you want to limit your user to enter only limited number of character in textbox provided by you using asp.net. Then you have to add an extra property to your textbox source; that is maxlength=”6”.  This property will limit the textbox according to your limit here it is 6. Before adding this property you must ensure that textbox you are using is Singleline not the having multiline property. 

 HTML |  copy code |? 
1
<asp:TextBox ID="TextBox1" MaxLength="4" runat="server"  />

Leave a Comment

Your email address will not be published.