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 7179715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:11:46+00:00 2026-05-28T17:11:46+00:00

I have a gridview which has an asp image-button for deleting a row. I

  • 0

I have a gridview which has an asp image-button for deleting a row. I implemented a fade effect while the row is being deleted; that’s working fine. My problem is the fade effect works always – whether the user has clicked ok or cancel. I want the fade effect only when user has clicked ok for the confirm box. I am stuck. Below is my code for the fade effect.

function removeRow() {
            if (confirm("Are you sure you want to delete this comment?")) {
                $("#dnn_BlogCommentManager1_grdBlogComments td: input[type='image']").click(function () {
                    $tr = $(this).closest("tr");
                    if ($(this).hasClass("imgDelete")) {
                        $tr.css("background-color", "red");
                        $tr.fadeOut(500, function () { $tr.remove() });
                    }
                });
            }
            else {
                return false;
            }
        }

I know I cannot place the click event inside the function, but I don’t know how I can get the clicked row inside the removeRow function.

  • 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-28T17:11:47+00:00Added an answer on May 28, 2026 at 5:11 pm

    Thanks Adam, its done instead of the if condition outside the qquery click event, i put it inside the click event like below

       $(\"#dnn_BlogCommentManager1_grdBlogComments td: input[class='imgDelete']\").click(function () {
           $tr = $(this).closest(\"tr\");
      if (confirm(\"Are you sure you want to delete this comment?\")) {
            if ($(this).hasClass(\"imgDelete\")) {
                 $tr.css(\"background-color\", \"red\");
                  $tr.fadeOut(500, function () { $tr.remove() });
              }
          }
          else {
           return false;
          }
      });
    

    Anyways thanks for showing your concern… thanks a lot.

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

Sidebar

Related Questions

I have a devexpress gridview within my asp.net page which has a filter row.
I have an ASP.NET GridView which has columns that look like this: | Foo
I have a GridView in which each row has a custom view. The grid
I have GridView which I can select a row. I then have a button
I have a GridView which has normal Edit/Update button. However, my GV RowUpdating, RowEditing
I Have a gridview which has a row that contains LinkButtons that were added
I have an ASP.NET gridview component which is being filled up with data from
I have gridview which has columns of data and a button below the Apply
ok i have a project which has many gridview in its pages... now i
I have a gridview within an updatepanel which allows paging and has a linkbutton

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.