开发者

passing dynamic values for each row in listview

i am using a list view for viewing some information to user there i used a hyperlink in each row to show detailed information in a modal popup in the same page what i want on the click of particular hyperlink the detailed report of that row only should display. [ID] is the primary key in my database iam passing that as an object from aspx file to the code behind and using that id to fetch data from database. but each time it is showing开发者_运维百科 same information.


<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 behind in the attach function

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

in the aspx again in the javascript

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

and using this hiddenfield value iam making a ajax call and the problem is solved

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜