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/

Advertisements

Datalist With Empty ROW

Showing Empty Row is just simple… only you need to do this in your asp.net page.

Datalist Empty Row

Steps to do

theDataList.DataSource = pagedData
theDataList.DataBind()

If theDataList.Items.Count = 0 Then
theDataList.Visible = False
lblError.Visible = True
Else
theDataList.Visible = True
lblError.Visible = False
End If