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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:01:35+00:00 2026-06-05T17:01:35+00:00

How do I pop up a delete confirm for a delete button in an

  • 0

How do I pop up a delete confirm for a delete button in an asp:GridView?

  • 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-05T17:01:39+00:00Added an answer on June 5, 2026 at 5:01 pm

    If you have a delete button for each row in a GridView, here is what I think is the best (and definitely easiest) way to have it put up an alert asking for confirmation. Here is the full aspx code (there is no code-behind needed):

    <asp:TemplateField ShowHeader="False">
      <ItemTemplate>
      <asp:LinkButton ID="DeleteButton" runat="server"
          CausesValidation="False"
          CommandName="Delete"
          OnClientClick='<%# Eval("Title", "return confirm(\"Delete the datasource {0}?\");") %>'
          Text="delete" />
      </ItemTemplate>
    </asp:TemplateField>
    

    A couple of notes:

    1. The CommandName must be Delete – that is what maps this to the
      GridView delete functionality.
    2. Title is the data column name of the
      title of that row. What you use here will depend on the
      column/property names of your data.
    3. Same for the word datasource –
      that is what we have rows of. You need to replace with what your
      data is called.
    4. I think <%$ resource_name %> should work for the
      text – but have not done that yet.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I pop up a message box to confirm a delete, from inside
I have a gridview control with delete asp:ImageButton for each row of the grid.
i have a asp:button that will fire a delete and want to have a
When Delete button is clicked, the confirmation box should pop up if the selected
How to pop up the Edit Text box when the button is tapped using
I want a confirm box to pop up when someone tries to submit this
I have a delete button that is tied to some comments on a page
I have a GridView which supports deleting. I'd like to add a pop up
Inside the grid I have a delete button inside a grid and have a
I would like a way to have a confirm box pop up when a

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.