Click here to Skip to main content
15,888,104 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how can i use ajax confirmation with gridview??

I have a gridview with delete image button its delete the record from sql database //I want to ask first before delete the record Like confirmation message not javascript by ajax ???




How can I use AJAX confirmation with gridview?

I have a gridview with a delete image button it deletes the record from an sql database using AJAX.

I want to ask confirmation first before the record is deleted.
Posted
Updated 20-Feb-10 18:42pm
v3

I wonder why you want to use AJAX and not Javascript confirm message.

AJAX will also work using XMLHttpRequest via javascript internally. Whats the point of using Scriptmanager/update panels and having so many requests and response?

You can associate onclick event to image button in your datagrid ItemdataBound event and you done with confirmation!
 
Share this answer
 
Add something like the following to the "delete image button" tag (which works for a "LinkButton"):
OnClientClick="return confirm('Are you certain you want to delete this product?');"


Source - http://www.asp.net/%28S%28pdfrohu0ajmwt445fanvj2r3%29%29/learn/data-access/tutorial-22-vb.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900