TelerikDeveloper.com

TelerikDeveloper.com

sgray128 1/25/2015 4:16:04 PM

ASP.NET - Button confirm dialog

This is a simple technique to get an 'Are you sure?' dialog to pop up when a button is pressed

 



 This is the button:

 

<telerik:RadButton ID="btnDelete" runat="server" Text="Delete" Width="120px" OnClientClicking="StandardConfirm"></telerik:RadButton>

 

 Place this piece of code at the top of the page

 

    <script type="text/javascript">
        function StandardConfirm(sender, args) {
        args.set_cancel(!window.confirm("Are you sure you want to delete this Household?"));
    }
</script