Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     

Ask Confirmation when delete the record

Ask Confirmation when delete the record from grid view or data grid

There are many conditions where we want to confirm from user that he want to delete the record from database or not when user clicks on delete button in Grid view, datalist or datagrid. Then there is a way to do this with javascript. We will show a alert user that if he clicks on Yes then record will delete, other wise not.

OnClientClick="return confirm('Are you sure to delete this record?');"
CommandName="Delete">Delete Comment</asp:LinkButton>
When user will click on the delete button then he will have to confirm the deletion.If he will click on yes button then the record will be deleted otherwise record will not be deleted.

Share this article   |    Print    |    Article read by 1757 times
Rohit kakria
I am software developer, moderator of
Related Articles:
Related Interview Questions: