c# - How do i limit the number of characters a user can type in a textbox? -


i want limit number of characters user can type in textbox (say no more 100 characters). how can achieve that?

you can use maxlength property.

this results in html this:

<input type="text" name="name" maxlength="100" /> 

however, it's worth mentioning validated on client-side , easy bypass. should validate on server-side, checking length of textbox.text property.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -