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
Post a Comment