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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:55:38+00:00 2026-05-26T04:55:38+00:00

I have gridview with four columns . All the data inside is generated in

  • 0

I have gridview with four columns. All the data inside is generated in RowDataBound event using Literals
eg.

      <asp:TemplateField HeaderText="" >
            <ItemTemplate>
                 <asp:HiddenField ID="ID"  Value='<%#Eval("id")%>' runat="server" />  

                <asp:Literal ID="ltrImage" runat="server"></asp:Literal>

            </ItemTemplate>
        </asp:TemplateField>  

       and

      <asp:TemplateField HeaderText="" HeaderStyle-HorizontalAlign="Center"
            ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Literal ID="lrtBrief" runat="server"></asp:Literal>      
            </ItemTemplate>
        </asp:TemplateField>    

In one of these Literals I am creating a <a> tag and I want to find the <%#Eval("id")%> value in click event of the <a> tag.

I did try something like this but didn’t work

$('.contactLink').click(function () {

    var grd = $('#MainContent_cphMain_DisplayResults1_gvDisplay');
    var txt = $(grd).find("cells[1].innerHTML").html();

});

HTML Looks Like this

<td align="center" style="width:5%;">
<input id="MainContent_cphMain_DisplaySearchResults1_gvListing_Listing_0" type="hidden" value="1" name="ctl00$ctl00$MainContent$cphMain$DisplaySearchResults1$gvListing$ctl02$Listing">
  <table class="contact">
  <tbody>
    <tr>
      <td valign="top">
      <h3>Test</h3>
      <h3>
      <a id="hlContact" class="contactLink format"  runat="server">Contact</a>
      <a id="hlViewF" class="viewLink format" href="CategoriesSearch.aspx?ID=1" runat="server">View </a>
      </td>
    </tr>
  </tbody>
  </table>
</td>

Any help will be appreciate

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-05-26T04:55:39+00:00Added an answer on May 26, 2026 at 4:55 am

    Note that you’re missing a closing h3 around your two links.

    $(".contactLink").click(function() {
        var value = $(this).closest("table") // Get the <a>'s closest <table>
                           .siblings(":hidden") // <hidden>
                           .val(); 
    });
    

    Fiddle for reference.

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

Sidebar

Related Questions

I have an ASP.NET GridView that has four columns. The first three are typical
I have GridView and I need HTML ENCODE all values being update using Event
I have a gridview in asp.net using vb 2005. on Protected Overrides Sub Rendersome
I have a GridView using LinqDataSource to populate data from table Tickets . The
I have a GridView with four columns, on each item I added my library
I have gridview which has columns of data and a button below the Apply
I have a GridView control in an Asp.net application, that has a <asp:buttonField> of
I have a GridView defined like this: <asp:GridView ID=myGridView ruant=server> <asp:BoundField DataField=myField /> <asp:CommandField
I have a gridview like below: <asp:GridView DataKeyNames=TransactionID AllowSorting=True AllowPaging=TrueID=grvBrokerage runat=server AutoGenerateColumns=False CssClass=datatable Width=100%
I have GridView that allows select. It takes data from EntityDataSource . How do

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.