Creating an AjaxValidator
Control
In this section, we create an extremely useful control named the AjaxValidator
control. Like the CustomValidator
control, the AjaxValidator
control enables you to create a custom server-side validation function. Unlike the CustomValidator
control, however, the AjaxValidator
control enables you to call the custom validation function from the browser.
The AjaxValidator
control uses AJAX (Asynchronous JavaScript and XML) to call the server-side validation function from the client. The advantage of using AJAX is that no postback to the server is apparent to the user.
For example, imagine that you create a website registration form and you need to validate a User Name field. You want to make sure that the User Name ...
Get ASP.NET 4 Unleashed 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.