First open Visual Studio and create new website after that right click on your website and add new folder and give name as JS and insert script files in folder you should get it from attached folder. After that write the following code in your aspx page

If you observe above code in header section I added some of script files and css files by using those files we have a chance to highlight controls when validation fails using JQuery in asp.net. Here one thing we need to remember that is if we want add validation for particular control then we need to add css class CssClass="ValidationRequired" to that particular control.

Now add following code in code behind

protectedvoid btnSubmit_Click(object sender, EventArgs e)

{

lblResult.Visible = true;

lblResult.Text = "Successfully Validated all the controls";

lblResult.ForeColor = Color.Green;

}

After run your application and check the output.

Demo

Download sample code attached

Here we can customize the script files based on our requirement if you observe above demo in that ZiP Code , Phone Number and Credit Card Number fields are allowing only numbers in particular format based on our settings in our script file.