Q&A

Q1:In the AddEntry.aspx Web page, the textboxes use the MaxLength property to limit the number of characters to the respective database table's column's size. (For instance, the Name textbox's MaxLength property is set to 50 because the Name column is a varchar(50).) Since the MaxLength property is browser dependent, certain browsers may not support the property. Is there any way to use a validation Web control to ensure that the user's input is within a certain number of characters?
A1: The RegularExpressionValidator can ensure that a user's input into a textbox falls within a certain range of characters. For example, in a user account–creation Web page, you might want the user to choose a password that you can ensure is from 6 to 15 characters. ...

Get SAMS Teach Yourself ASP.NET in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.