The CustomValidator Control

The CustomValidator control enables you to create your own validation function in both client and server code. The server code you write can be developed in your default language (for example: C#.NET), but, for your client script, you must write in a scripting language that your target browser supports. Today's most widely used client-scripting languages are JavaScript and its competing Microsoft version, JScript. If you're developing strictly for Internet Explorer, you can write in VBScript.

We'll focus primarily on two things. The first is the ServerValidate event. You need to handle this event to perform server-side validation using the CustomValidator control. This event expects two parameters: Object, and ServerValidateEventArgs ...

Get Programming Data-Driven Web Applications with ASP.NET 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.