Skip to Content
ASP.NET 3.5 For Dummies®
book

ASP.NET 3.5 For Dummies®

by Ken Cox
February 2008
Intermediate to advanced
428 pages
8h 52m
English
For Dummies
Content preview from ASP.NET 3.5 For Dummies®

19.7. Validating by Groups

A busy Web form — especially one that uses ASP.NET AJAX — can have numerous text boxes and buttons that are independent of each other. Instead of trying to validate every control on the page at the same time, you can validate controls in groups. To include controls in a group, set their ValidationGroup property to a common value.

Figure 19-6 shows the Design view of two independent validation groups on the same ASP.NET page. The upper section checks for a number from 1 to 10. The lower section includes a required field. At runtime, click OK to validate the number even though the required field is empty.

All the controls in the upper section include the ValidationGroup="Range" attribute and value pair. The controls in the lower section are grouped by the common "Required" value.

Figure 19-6. Two independent validation groups on a page.
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.
Start your free trial

You might also like

ASP.NET 3.5 Unleashed

ASP.NET 3.5 Unleashed

Stephen Walther
ASP.NET 4 Unleashed

ASP.NET 4 Unleashed

Stephen Walther, Kevin Hoffman, Nate Dudek

Publisher Resources

ISBN: 9780470195925Purchase book