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

 

There are two ways to do this:

Method 1:

<telerik:RadButton runat="server" ID="RadButton1" Text="RadButton">
    <ConfirmSettings ConfirmText="Are you sure you want to continue?" />
</telerik:RadButton>

Method 2

 

<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

RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences