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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:27:43+00:00 2026-06-08T23:27:43+00:00

I have a gridview in my asp.net project and i used item template like;

  • 0

I have a gridview in my asp.net project and i used item template like;

<asp:TemplateField>
                  <ItemTemplate>
                        <asp:LinkButton ID = "lnkSil" runat="server" CommandName="bla" 
CommandArgument='<%# ((GridViewRow) Container).RowIndex %>' Text= "Sil" ></asp:LinkButton>
                  </ItemTemplate>
                  </asp:TemplateField>

And I want to catch this from code behind and i used below code ;

((Button)e.Row.Cells[1].Controls[0]).Attributes.Add("onclick", "return confirm('Bu kaydi silmek istediginizden emin misiniz?')");

but I’m failed how can i catch this controls on code behind like this

also i tried

((LinkButton)e.Row.Cells[1].Controls[0]).Attributes.Add("onclick", "return confirm('Bu kaydi silmek istediginizden emin misiniz?')");
  • 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-08T23:27:45+00:00Added an answer on June 8, 2026 at 11:27 pm

    if you want to get access to the event without javascript then use the GridView1_RowCommand.

     protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
     {
         int currentRowIndex = Int32.Parse(e.CommandArgument.ToString());
         LinkButton bf = (LinkButton)gv.Rows[currentRowIndex].Cells[1].Controls[0];
         ...
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hy, I have a gridView control in Asp.NET like this: <asp:GridView ID=outputGridView runat=server onrowediting=OutputGridView_RowEditing>
I have a traditional ASP.NET GridView. Inside of it I have a Template Field
I am new ASP.NET and I have never used a GridView or DataGrid, but
I am working with asp.net 2.0 project. I have a gridview in one of
I have gridview in my asp.net 3.5 application [C#]. Which looks like this: <asp:GridView
On an ASP NET project I have a gridview control with the following information:
I am working on a ASP.Net project. I have SQL Server Database linked with
i have gridview in my asp.net webform. i bind my database to gridview like
I am working on an asp .net project. I have a gridview and on
I have a web project in C#/asp.net. I have a UserControl with a GridView

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.