想要将列表视图项值传递给 javascript 函数,此控件位于布局模板内,即锚标记。我正在将数据绑定到此锚标记,并希望在此单击时调用 javascripot 函数。
<asp:ListView ID="ListviewInnerComent" runat="server" DataKeyNames="ID" OnItemDataBound="ListviewInnerComent_ItemDataBound" OnItemCommand="ListviewInnerComent_ItemCommand">
<LayoutTemplate>
<ul id="itemPlaceholderContainer"runat="server">
<li id="itemPlaceholder" runat="server">
</li></ul>
<div >
<a href='<%# Eval("ID") %>' id="showmore" class="showmore" runat="server" onclick="GetRecords1();" >Show More</a>
//WANT TO PASS THIS ANCHOR TAG VALUE THAT i AM BINDING TO JAVASCRIPT FINCTION.
</div>
</LayoutTemplate>
function GetRecords1
(response) {
var xmlDoc = $.parseXML(response.d);
var xml = $(xmlDoc);
var ID=document.getElementById("showmore").title;
alert(ID);
WANT TO CALL PASSED VALUE HERE
}