Passing dynamic values ​​for each row in a list

I use the list view to view some information for the user where I used a hyperlink in each row to show detailed information in a modal popup on the same page that I want on clicking a specific hyperlink, a detailed report of this row should only be displayed. [ID] is the primary key in my iam database, passing it as an object from an aspx file to the code behind and using this identifier to retrieve data from the database. but each time it shows the same information.

+1
source share
1 answer
<asp:HyperLink ID="hlnkShow" runat="server" CssClass="showButton" OnClick='<%# Attach(Eval("ID")) %>' Text="Show" ToolTip="View the contents of the message"> </asp:HyperLink> 

in the code located in the attach function

 protected string Attach(object ObjectID) { return ("return showComments($(this),'" + ObjectID + "');"); } 

in aspx again in javascript

 function showComments($element, objectID) { $('input[type=hidden][id$=hfObjectID]').val(objectID); } 

and using this iam hidden field value making an ajax call and the problem is solved.

0
source

All Articles