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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:21:15+00:00 2026-06-11T19:21:15+00:00

im using asp.net with c#. I have a gridview and there is a TemplateField

  • 0

im using asp.net with c#.

I have a gridview and there is a TemplateField column. Inside the TemplateField column there is a EditItemTemplate, and inside EditItemTemplate the is a linkbutton(LinkButton1).

Im trying to do a getelementbyid on the linkbutton from a javascript function:

document.getElementById("<%= LinkButton1.ClientID %>").disabled = true;

But when compiling, I get the error: “The LinkButton1” does not exist on the current context.

The aspx gridview code:

<asp:GridView ID="GridView1" runat="server" Height="157px" Width="814px" 
             CellPadding="4" ForeColor="#333333" GridLines="None"
             OnRowEditing="GridView1_RowEditing"
             OnRowCancelingEdit="GridView1_RowCancelingEdit" 
             OnRowUpdating="GridView1_RowUpdating" AutoGenerateColumns="False" 
             OnRowDataBound="GridView1_RowDataBound"
              onrowdeleting="GridView1_RowDeleting" Font-Size="Medium" 
            AllowPaging="True" onpageindexchanged="GridView1_PageIndexChanged" onpageindexchanging="GridView1_PageIndexChanging"     >
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<Columns>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
            Text="Actualizar" ValidationGroup="upd_validation"></asp:LinkButton>
        <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
            Text="Cancelar"></asp:LinkButton>
</EditItemTemplate>      
<ItemTemplate>
        <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" CommandName="Edit"
            Text="Editar"></asp:LinkButton>
        <asp:LinkButton ID="LinkButton4" runat="server" CausesValidation="False" CommandName="Delete"
            Text="Eliminar" CommandArgument='<%# Container.DataItemIndex %>' onclientClick="return ConfirmDelete()"></asp:LinkButton>                         
</ItemTemplate>                
</asp:TemplateField>

How can I solve this?

Thanks.

  • 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-11T19:21:16+00:00Added an answer on June 11, 2026 at 7:21 pm

    U can add some dummy css class to the LinkButton (example “disableLink”), and then using Jquery, u can easily achieve it using the below code

      $('.disableLink').each(function (i, obj) { 
          $(this).disabled = true;
          // OR
          $(this).attr('disabled','disabled');
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using asp.net 3.5 Gridview control, visual studio 2008. I have played with all the
Using ASP.NET VB, I have a form with some text boxes and a Gridview.
I have an ASP.NET(2.0 using C#) web app, in which I have a gridview.
I am using C#,ASP.NET I have a Gridview for which I have provided Sorting,
I have a gridview in asp.net using vb 2005. on Protected Overrides Sub Rendersome
I'm using the ASP net Ajax toolkit and have a GridView within the UpdatePanel
I have asp.net page where I am using a gridView with custom paging and
I have a gridview that is populated from an entitydatasource in asp.net. In my
I am trying to populate an (editable) gridview in ASP.NET with a table from
sending mail along with embedded image using asp.net I have already used following but

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.