Fixed nunber of char in multiline text box
-
I am using multiline text box.i set size of it 200. i set property MaxLength="200". and i am also using RangeValidator of set the fixed no of char. But it will not working ,it will accept more then 200 char. plz anyone help me.i will very thankful for him.
-
I am using multiline text box.i set size of it 200. i set property MaxLength="200". and i am also using RangeValidator of set the fixed no of char. But it will not working ,it will accept more then 200 char. plz anyone help me.i will very thankful for him.
-
I am using multiline text box.i set size of it 200. i set property MaxLength="200". and i am also using RangeValidator of set the fixed no of char. But it will not working ,it will accept more then 200 char. plz anyone help me.i will very thankful for him.
MaxLength
property does not work for when you setTextmode="multiline"
. So, you can useValidatorControl
to Validate the range. I am not sure why this is not working for you. You can Try like this.Another alternative solution is to developed one custom control. I found one great article in Codeproject It self. Extending the ASP.Net Multiline TextBox control to limit the number of characters entered[^] And For your more Information Read this Post MaxLength ignored in multiline textbox.[^] Hope this will resolve your problem. Let me know if you need more help.
Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.
-
I am using multiline text box.i set size of it 200. i set property MaxLength="200". and i am also using RangeValidator of set the fixed no of char. But it will not working ,it will accept more then 200 char. plz anyone help me.i will very thankful for him.
Hi, You can use JS to control it. In page: <script type="text/javascript"> function validatorTextLength(obj) { if(obj.value.length==200) { event.keyCode = 0; return ; } } </script> And in CodeFile, you need to set TextBox1.Attributes.Add("onkeypress","validatorTextLength(this)"); when pageload. Good luck.
April Comm100 - Leading Live Chat Software Provider