Javascript confirm dialogs from link buttons of Datagrid

If you are using DataGrid or GridView in ASP.Net, we may require to display a confirmation, like when you are deleting a record. This code will help to display confirmation dialogs from Client side, with ASP.Net Datagrid control or Gridview control etc.

<span onclick="return confirm('Are you sure you want to delete this record?');">
<asp:linkbutton runat="server" id="Delete" CommandName="Delete"
commandArgument='<%#Container.DataItem("field")%>' Text="Delete" />
</span>

No related content found.

This entry was posted in .Net, Javascript and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>