asp.net

ASP.NET Client-side Validation & Confirmation Popup

The other day I was working on a project for our client. They wanted some client-side validation to be done on the page to avoid postbacks, since postbacks could take REALLY long on a slow connection. They also wanted a javascript confirmation popup before processing the form.

In the page, I had a few RequiredFieldValidators, as well as some RegularExpressionValidators. Initially, I modified the submit button to include the confirmation message, and check whether the page is valid or not. Below is a snippet of the ASP.NET button that I had in my page.

 

Syndicate content