Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8522609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:10:21+00:00 2026-06-11T07:10:21+00:00

I am using a radbutton. On the onclick event I have a piece of

  • 0

I am using a radbutton. On the onclick event I have a piece of code that runs an SQL query to delete a record.

I want to return a confirm message box for this but I am not having any luck getting it to run.

  • I have tried adding it to the onclientclick event,
  • I have tried adding it to the attributes in the code behind when the button click event fires,
  • and I have tried the Page.RegisterStartupScript("clientScript", message).

Each one of these is deleting the account before the return confirm is executed.

I have commented out my delete code and the message will fire then. In the adding it to the attributes case, it worked after I pushed the delete button twice. I have been researching this for several days and have not found a suitable code yet. Any help would be appreciated.

Updated – added code.

Code I have tried:

    string message = "<script language=JavaScript> alert( ' The ' );</script>";

    if (!Page.IsStartupScriptRegistered("clientScript"))
    {
        Page.RegisterStartupScript("clientScript", message);
    }

And

    RadButton btn = (RadButton)sender;

    string strMessage = "Are you sure?";

    btn.Attributes.Add("onclick", "return confirm('" + strMessage + "');");

Here is the button

    <telerik:RadButton ID="btnDeleteAccount" runat="server" Font-Bold="True" Font-Names="Arial"
    Font-Size="11px" Skin="WebBlue" Text="Delete Account" OnClick="btnDeleteAccount_Click"
    Width="150px">
    </telerik:RadButton>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T07:10:22+00:00Added an answer on June 11, 2026 at 7:10 am

    I finally found a piece of code that worked. I must have been entering some incorrect javascript.

    Here is the code I found that worked for me.

    OnClientClicking="function (sender, args){args.set_cancel(!window.confirm('Are you sure you want to delete this account?'));}"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an HTML form using dojo and have the following code for a
Without using code, how can I turn this into a Template? I have about
Using Asp.net MVC, I have one view that's strongly bind to List , and
When I want to change the state of radiobuttons using AJAX, I discovered that
Hi i want to get radiobutton value using jquery. This is the radiobutton code.
Using a populated Table Type as the source for a TSQL-Merge. I want to
Using SQL Server 2008 R2 we are looking for a way to select the
I have a list of RadioButton : RadioButton1 RadioButton2 RadioButton3 And I want to
I have a WPF ListView control containing a number of RadioButton controls using data
I have an ASP.Net-MVC application that is mostly complete. However, I have one page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.