Click here to Skip to main content
15,885,065 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I used rowCommand , and linkButton to delete from gridview, it worked..
Please let me how to show confirmation box before deleting ...
Posted
Comments
AmitGajjar 28-Dec-12 5:35am    
use javascript to display confirmation box.

1 solution

Try:
ASP.NET
<asp:LinkButton runat="server" ID="myLinkButton" OnClientClick="return confirm('Are you sure you wish to continue?');" Text="Click Here" PostBackUrl="http://www.somesite.com/somelink.html" ></asp:LinkButton>

Or a more advanced route.

Javascript:
JavaScript
<script type="text/javascript">

    function doConfirm() {

        // do some stuff here first, e.g. form validation

        return confirm('Are you sure you wish to continue?');

    }

</script>


ASP:
ASP.NET
<asp:LinkButton runat="server" ID="myLinkButton" OnClientClick="return doConfirm();" Text="Click Here" PostBackUrl="http://www.somesite.com/somelink.html" ></asp:LinkButton>
 
Share this answer
 
v4

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