ASP.NET ListView Item Delete Confirmation using jQuery Colorbox

The other day I was working on a .NET project I needed to perform a delete confirmation using jQuery Colorbox in ASP.NET ListView. After I spend long hours on internet I couldn’t find solution and come up with this idea. Hope you will enjoy it 🙂

Solution

Step 1: Add jQuery and Colorbox

you can download colorbox from https://github.com/jackmoore/colorbox

You can find jQuery Colorbox examples here http://www.jacklmoore.com/colorbox/

Step 2: Add the following inside < head > tag

Step 3: ASP.Net Listview using CommandArgument to delete the item

 

You can find much detailed information from ASP.NET Wiki: https://wiki.asp.net/page.aspx/1809/aspnet-listview-item-delete-confirmation-using-jquery-colorbox/

jQuery validation Group for ASP.NET

ASP.Net Validation Group won’t work well with jQuery CSS Form Validators.  So here in this jQuery Group Validation we are going to use two logical input forms “#product” and “#productcategory”

The main idea of separating validation groups is to notify jQuery validation that it should just ignore any input elements outside the active Div ID groups. Here we are going to use jQuery validate() ignore option and the jQuery not selector, by telling dynamically the validation object to ignore all the input elements outside the active logical form.