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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:41:14+00:00 2026-05-21T08:41:14+00:00

I have a asp.net webapp and I am using Jquery. I wanted to know

  • 0

I have a asp.net webapp and I am using Jquery. I wanted to know how can I pull data out of created table on the client side. I tried a few different ways but known work. I just want to be able to say when click alert the data in the row from a hidden class i got with a UID. Please note this is asp.net not regular html. So to sum it up I have a listview that creates a table, and each row thats created I store the ID in a 333-444-556-66 like that. And when a user clicks on a row I alert that ID from that class. 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-21T08:41:15+00:00Added an answer on May 21, 2026 at 8:41 am

    The easiest way to do this is to forget about the fact that this is ASP.NET and start treating it like HTML. So you need to pass an ID to the client? Just add it to the HTML, e.g. in your markup:

    <ItemTemplate>
        <asp:TableRow id="TemplateRow" datakey='<%# Eval("MyDataKeyField")>' %> />
        ...
    </ItemTemplate>
    

    or in code:

    override void OnInit(EventArgs e) {
         ListView1.ItemDataBound += new 
             EventHandler<ListViewItemEventArgs>(ListView1_ItemDataBound);
    }
    
    protected void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e)
    {
        TableRow row = e.Item.FindControl("TemplateRow");
        row.Attributes["datakey"]=((MyDataSourceType)e.Item.DataItem).MyDataKeyField;
    }
    

    so now you will have HTML that renders like this:

    <table class="myDataTable">
       <tr id="$some$insane$asp$dot$net$id" datakey="555-66">
          <td> ... </td>...
       </tr>
       ...
    </table>
    

    Then in jQuery. Ignore the asp.net ID. It is of no use to anyone but asp.net. Your own ID, however, is exactly as you rendered it. So just grab it.

    $(document).ready(function() {
       $('.myDataTable tr').click(function(e) {
           var $my_id = $(this).attr('datakey');
           alert($my_id);
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building an asp.net MVC2 web app using StructureMap. I have created a
I have started to make a webapp with asp.net mvc2. I am using the
I am working on a web app using C# and asp.net I have been
OK, this begins to drive me crazy. I have an asp.net webapp. Pretty straightforward,
I have ASP.NET web pages for which I want to build automated tests (using
I have a little problem about using jQuery (I really do not know jQuery
I'm using jQuery and SimpleModal in an ASP.Net project to make some nice dialogs
I have created an ASP.NET Webforms web application which basically inetracts with the code
Let's say I have an ASP.NET MVC webapp that calls a repository layer, which
Im currently making a very simple WebApp on a Website using ASP.NET Framework using

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.