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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:26:58+00:00 2026-06-15T11:26:58+00:00

I have a LinkButton inside a GridView that passes a CommandArgument and tries to

  • 0

I have a LinkButton inside a GridView that passes a CommandArgument and tries to fire RowCommand

GridView declaration:

<asp:GridView PageIndex="0" OnRowCommand="GridView1_RowCommand" PageSize="10" AllowPaging="true" OnPageIndexChanging="GridView1_PageIndexChanging"
ID="GridView1" runat="server" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None"
BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Horizontal" Width="700px"
AutoGenerateColumns="False" OnPageIndexChanged="GridView1_PageIndexChanged">

LinkButton inside the GridView:

<asp:TemplateField>
    <ItemTemplate>
        <asp:LinkButton ID="LinkButton1" OnClientClick="return confirm('Are you sure you want to delete this checklist?');" runat="server" CausesValidation="false" CommandName="DeleteChecklist" CommandArgument='<%# Eval("refID") %>' Text="Delete"></asp:LinkButton>
    </ItemTemplate>
    <ItemStyle ForeColor="Black" />
    <ControlStyle BorderStyle="None" ForeColor="Black" />
</asp:TemplateField>

Code behind:

protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
    if (e.CommandName == "DeleteChecklist")
    {
        string refID = e.CommandArgument.ToString();
        DAL.DeleteChecklist(refID);
     }
}

I placed a breakpoint at RowCommand but it doesn’t get fired at all, any idea why?

  • 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-15T11:26:59+00:00Added an answer on June 15, 2026 at 11:26 am

    I assume that you’re databinding the GridView on postbacks. So always embed it in a if(!IsPostBack) check:

    protected void Page_Load(Object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
             GridView1.DataSource = getSource();
             GridView1.DataBind();
        }
    }
    

    Otherwise events won’t be triggered and edited values will be overridden.

    Another possible reason: Have you disabled ViewState?

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

Sidebar

Related Questions

I have a gridview inside an update panel.In that gridview, I have a linkbutton
I have a datagrid with linkbutton inside it. <asp:DataGrid id=listDataGrid Runat=server> <Columns> <asp:TemplateColumn HeaderText=Item
I have a LinkButton inside an UpdatePanel that I do not want the client
I have a gridview with a linkbutton inside a <HeaderTemplate> . There is an
I have a gridview inside of a div that is displayed with ajax. I
I have Repeater with LinkButton with ID CommandArgument When I click that button, I
I have a linkbutton inside a listbox that receives a list of objects. I'm
i have Linkbutton inside updatePanel and when i click on it it returns following
I have a linkbutton in gridview and i want to click event on code
In gridview's column i have a linkbutton and a label under it. I want

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.