Hello everyone,
I would like to add a confirmation modal after the click of delete in gridview.
The problem is that with this addition the delete takes place only for the first row of the gridview even if I try to delete another row.
I have the code below inside a gridview itemtemplate
Is there a way to pass to bootstrap modal the right parameters that will be relevant to the clicked row?
Thank you in advance..
<asp:LinkButton ID="diagrafi" runat="server" type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#delete_Modal">
<asp:Image ID="Image1" Width="20px" runat="server" ImageUrl="images/del.png"/>
</asp:LinkButton>
<div class="modal fade" id="delete_Modal" tabindex="-2" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span></button>
<h4 class="modal-title">
delete command
</h4>
</div>
<div class="modal-body">
<p>
are you sure?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" onclick="myFunction()"> cancel</button>
<asp:Button ID="epivevaiosi" CommandArgument='<%#Eval("kodikos")+"|"+Eval("tablename")%> '
CommandName="DeleteRow" runat="server" type="button" Text="delete" class="btn btn-primary"/>
</div>
</div>
</div>
</div>