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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T21:31:05+00:00 2026-05-28T21:31:05+00:00

I am using the following C# to replace the texts ‘Edit, Delete and Select’

  • 0

I am using the following C# to replace the texts ‘Edit, Delete and Select’ from the command row on GridViews.

I want to improve this by using a javascript ‘confirm’ dialogue to make the user double check before deleting a row. How can I do this from the LinkButton object?

private void commandIcons(GridViewRow row)
{
    if (row.Cells[0].Controls.Count == 5)
    {
        // we have a edit delete select control row type, replace text labels with icons
        LinkButton lbedit = (LinkButton)row.Cells[0].Controls[0];
        lbedit.Text = lbedit.Text == "Edit" ? "<img title=\"Edit\" class=\"icon\" src=\"Images/database_edit.png\" />" : lbedit.Text;

        LinkButton lbdelete = (LinkButton)row.Cells[0].Controls[2];
        lbdelete.Text = lbdelete.Text == "Delete" ? "<img title=\"Delete\" class=\"icon\" src=\"Images/delete.png\" />" : lbdelete.Text;

        LinkButton lbselect = (LinkButton)row.Cells[0].Controls[4];
        lbselect.Text = lbselect.Text == "Select" ? "<img title=\"Select\" class=\"icon\" src=\"Images/accept.png\" />" : lbselect.Text;
    }
}
  • 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-28T21:31:06+00:00Added an answer on May 28, 2026 at 9:31 pm

    You can add an “OnClientClick” to an linkbutton asking for confirmation. And performing an C# function afterwards using “OnClick”. Hope it helps.

    <asp:LinkButton ID="Deletebutton" runat="server" CausesValidation="False" OnClientClick='return confirm("Are you sure you want to remove this?");'  OnClick="DeleteBrand">
    

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

Sidebar

Related Questions

Let's suppose I have the following regex: -(\d+)- and I want to replace, using
I'm using the following logon trigger on an Oracle 10.2 database: CREATE OR REPLACE
I am using following query which works fine for me except one problem SELECT
I am decoding a file using the following method: string outFileName = zfoFileName.Replace(.zfo, _tmp.zfo);
I am using following code to replace the passwords in my app.config. It replaces
I want to replace the contents within a html element so I'm using the
How can i generate multiple texts using the imagecreatetruecolor() method? I have the following
I'm using the following code to open a blank window from a secure page:
I'm trying to replace each textNode of the DOM tree using the following function:
I am trying to replace text in a footer, I am using the following

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.