Home > Asp Net > Asp Net Textbox Maxlength Not Working

Asp Net Textbox Maxlength Not Working

Tried setting it in the Forms designer properties and in Form.cs but it seems to get totally ignored, very strange. Follow @ASPSnippets Follow @ASPSnippets Name Required Email Required Invalid Email Address Comment Required Security code: Required Invalid security code. txtNot.Attributes.Add("MaxLength", "200"); Monday, December 03, 2012 1:36 PM 1 Sign in to vote Just throwing a code behind solution to this problem, as an alternative to the Javascript ones already supplied. Here I am going to share the two ways which I found Through Javascript:Here is the Javascript code which should be added. Reply srinivas.ch2... Note: The character count control can only HTML SPAN or DIV. 3. May 21, 2008 03:05 AM|smoothmovz|LINK

Reply atikatak None 0 Points 18 Posts Re: MaxLength ignored in multiline textbox. Cheers!!

Put the following function in your page.