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

  • Home
  • SEARCH
  • 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 6927649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:04:58+00:00 2026-05-27T11:04:58+00:00

My code make deleting item before I confirm it. How can I make a

  • 0

My code make deleting item before I confirm it. How can I make a change to let it deletes item after I confirm it. Here is javascript code:

<script type="text/javascript">
    var _source;
    var _popup;

    function showChild_Delete(source) {
        this._source = source;
        this._popup = $find('popupChild_Delete');
        this._popup.show();
    }

    function btnChild_Delete_Click() {  
        this._popup.hide();
        __doPostBack(this._source.name, '');
    }                     
</script>

asp.net code call js code:

<asp:ImageButton ID="btnChild_Delete" runat="server" SkinID="delete" OnClientClick="showChild_Delete(this); return false;"
                                                    CommandName="deleteChild" CausesValidation="False" CommandArgument='<%# Eval(childID) %>' />

C# code:

 if (e.CommandName == "deleteChild")

    {
        hashTable.Add(childID, e.CommandArgument);
        sqlData.GetDataTable(sproc_delChild, hashTable);

        gvChild.SelectedIndex = -1;
        pnlChild_Upload.Visible = false;
        this.upnlChildUpload.Update();

        RefreshChild();
    }

I will appreciate any help.

  • 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-05-27T11:04:59+00:00Added an answer on May 27, 2026 at 11:04 am

    You would want to do something client-side in javascript prompting them to accept their decision before doing it…

    <script type="text/javascript">
        function btnChild_Delete_Click() {  
            this._popup.hide();
    
            // the _doPostBack is triggering the delete. simply writing something here.
            if (!confirm('Are you sure?')) return;
    
            __doPostBack(this._source.name, '');
        }                     
    </script>
    

    EDIT: to do this with a stylized confirmation window I would do the following (example is pseudo-code to exemplify logic flow).

    1. Make a DIV for confirmation of the deletion. Stylize it as you like in CSS and hide it (either by making it display:none, or off-screen with margins.

      <div id="confirmationBox">
          <p>Are you sure?</p>
          <button id="doDelete">Delete</button>
      </div>
      
    2. Alter your script to call a function that shows/hides the confirmation DIV:

      function buttonConfirmDelete_Click {
          // 1. display the confirmation box.
      }
      
      function buttonDoDelete_Click {
          __doPostBack(this._source.name, '');
          // 2. hide the confirmation box.
      }
      

    The result is your existing delete button simply unveils the delete button that actually performs the call back which is now contained within the confirmation popup.

    there are certainly more clean ways to do this, but it seems like you are looking for a quick and easy solution.

    That answer your question?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make my jQuery code refreshing the div after deleting a post.
I am currently using a javascript code to make an entire row in my
Sometimes a labeled break or continue can make code a lot more readable. OUTERLOOP:
What do I have to change in the following code to make the A
PyPy's JIT can make Python code execute much faster than CPython. Are there a
I have this code: <meta http-equiv=content-type content=text/html; charset=<?php echo $stigConfig['charset']; ?> /> How can
I'm trying to reorganize my code and make it more unobstrusive. Mainly, there is
I am using the following code to make a HttpWebRequest and render the XML
I'm trying to use the following code to make an image fadeOut and, only
I've been going through the process of cleaning up our controller code to make

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.