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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:44:36+00:00 2026-06-18T14:44:36+00:00

I have gridview and inside it I have a button, I want to call

  • 0

I have gridview and inside it I have a button, I want to call a jQuery function on its click.

Here is my narkup:

<asp:GridView ID="gvContactUs" runat="server" AllowSorting="True" AutoGenerateColumns="False"
     DataKeyNames="ContactID" Width="100%" CellPadding="3" CellSpacing="1" 
     OnPageIndexChanging="gvContactUs_PageIndexChanging"
     OnRowCommand="gvContactUs_RowCommand" 
     OnRowDataBound="gvContactUs_RowDataBound"
     OnRowDeleting="gvContactUs_RowDeleting" 
     OnSorting="gvContactUs_Sorting" AllowPaging="True"
     BackColor="White" BorderColor="White" BorderStyle="Ridge" 
     BorderWidth="2px" GridLines="None">
     <Columns>
         <asp:TemplateField HeaderText="Edit" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="3%">
             <ItemTemplate>
                 <asp:Button Text="text" ID="hello" runat="server" />
             </ItemTemplate>
             <HeaderStyle Width="7%" />
             <ItemStyle HorizontalAlign="Center" />
         </asp:TemplateField>
         <asp:TemplateField HeaderText="Name" ItemStyle-HorizontalAlign="Left">
             <ItemTemplate>
                 <%#Eval("Name")%>
             </ItemTemplate>
             <ItemStyle HorizontalAlign="Left" />
             <HeaderStyle Width="11%" />
         </asp:TemplateField>
         <asp:TemplateField HeaderText="Email" ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="13%">
             <ItemTemplate>
                 <a href="mailto:<%#Eval("Email")%>" class="EmailLink">
                 <%#Eval("Email")%></a>
             </ItemTemplate>
             <HeaderStyle Width="13%" />
             <ItemStyle HorizontalAlign="Center" />
         </asp:TemplateField>
         <asp:TemplateField HeaderText="Phone" HeaderStyle-HorizontalAlign="center" HeaderStyle-Width="7%">
             <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
             <ItemStyle HorizontalAlign="Center" Width="40px" />
             <ItemTemplate>
                 <%#Eval("Phone")%>
             </ItemTemplate>
             <HeaderStyle Width="8%" />
         </asp:TemplateField>
         <asp:TemplateField HeaderText="Status" HeaderStyle-HorizontalAlign="center" HeaderStyle-Width="7%">
             <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
             <ItemStyle HorizontalAlign="Center" Width="40px" />
             <ItemTemplate>
                  <%#Eval("Subject")%>
             </ItemTemplate>
             <HeaderStyle Width="13%" />
         </asp:TemplateField>
         <asp:TemplateField HeaderText="Delete" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="7%">
             <ItemTemplate>
                 <asp:LinkButton CommandName="Delete" CommandArgument='<%#Eval("ContactID") %>' runat="server" ID="lnkbtnDelete">
                     <img src="Images/delete.gif" border="0" alt='Click to Delete this Entry' title='Click to Delete this Entry' />
                 </asp:LinkButton>
             </ItemTemplate>
             <HeaderStyle Width="7%" />
             <ItemStyle HorizontalAlign="Center" />
         </asp:TemplateField>
     </Columns>
     <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
     <HeaderStyle Height="30px" BackColor="#3E3050" Font-Bold="True" ForeColor="#ffffff" />
     <PagerStyle ForeColor="Black" BackColor="#C6C3C6" HorizontalAlign="Right" />
     <RowStyle Height="25px" BackColor="#DEDFDE" ForeColor="Black" />
     <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
     <SortedAscendingCellStyle BackColor="#F1F1F1" />
     <SortedAscendingHeaderStyle BackColor="#594B9C" />
     <SortedDescendingCellStyle BackColor="#CAC9C9" />
     <SortedDescendingHeaderStyle BackColor="#33276A" />
 </asp:GridView>

jQuery code is :

 $('[id$=hello]').live('click', function (e) {
        alert('hi8');

    });


    $(function () {

        $('input[id$=hello]').click(function () {

            alert('hikkk');
            return false;
        });
    });

These two things I have tried but still not able to call the jQuery function.
Please help me…

  • 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-18T14:44:37+00:00Added an answer on June 18, 2026 at 2:44 pm

    Use attributes contains selector * instead of attribute ends with $. Also ensure you have successfully included required jQuery library.

    $(function () {    
          $('input[id*=hello]').click(function () {    
                alert('hikkk');
                return false;
          });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a button inside my <ItemTemplate> in GridView and I want to call
I have GridView and Button controls nested inside a Panel . <asp:Panel ID=PanelPopUp runat=server>
I have a button inside of a gridview's template field. Onclick i want to
I have a input button inside my gridview. I am capturing the button's click
I have a gridview and a button inside it. What I want to do
How to apply textbox blank validation on button click inside gridview in javascript?I have
I have a dropdownlist inside the gridview. Now i want when i click on
I am using DevExpress gridview that have a command button inside. I want to
I have a TemplateField column in a gridview with a button inside of it.
I've got an asp.net gridview inside an updatepanel. One of the fields I have

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.