Skip to Content
Beginning ASP.NET 3.5: In C# and VB
book

Beginning ASP.NET 3.5: In C# and VB

by Imar Spaanjaars
March 2008
Intermediate to advanced
766 pages
21h 15m
English
Wrox
Content preview from Beginning ASP.NET 3.5: In C# and VB

9.4. Summary

User input is an important aspect of most interactive web sites. It comes from different sources in your web site: the contact form you created in this chapter, the query string, and other sources. To stop users from entering invalid or even dangerous content into your system, it's important to validate all input before you work with it.

The validation controls that ASP.NET supports make it easy to validate all data coming from form controls, such as TextBox, DropDownList, Calendar, and so on. The RequiredFieldValidator helps to ensure that a user has filled in a required field. The RangeValidator, CompareValidator, and RegularExpressionValidator are used to check the contents of the data against settings you define at design time. The CustomValidator allows you to write validation code that is not covered by the built-in validation controls, giving you maximum flexibility. The ValidationSummary control is used to give feedback about the errors that your users made while entering data. It can display these errors as a simple bulleted list in the page, or as a JavaScript alert window.

The biggest benefit of the validation controls is that they work at the client and at the server, enabling you to create responsive forms where a user gets immediate feedback about any errors they may have made, without the need for a full postback. At the same time, the data is validated at the server, ensuring that data coming from clients that don't support JavaScript is valid as well. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Bill Evjen, Scott Hanselman, Devin Rader

Publisher Resources

ISBN: 9780470187593Purchase book