Bringing It All Together
By using the validation controls you learned about in this chapter, it is possible to create very sophisticated forms with a minimum of code. To demonstrate this capability, we will combine all the examples we have looked at so far in this chapter into one form, and combine this with a ValidationSummary control to provide a summary of all errors found on the form. This example also includes one new validation for ensuring that a user's password and confirmed password match.
In the interests of conserving space, we won't display the full source code for this example here. Figure 8.5 shows what the end result looks like with a few errors. You can see the live version of this example with full VB and C# source code at
Get ASP.NET by Example 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.