I have a listview with label which displays messages from different user.I have used the table row <tr> to get the id and pass it to the javascript.Now i need to pass this javascript variable to the .cs file.
<asp:ListView ID="msg_list" runat="server" OnItemCommand="selectedMsg" >
<ItemTemplate>
<table>
<tr class="myitem" onclick=" selectedid(<%#Eval("senderId")%>) "/>
<td>
<asp:Label role="menuitem" ID="msg_lbl" runat="server" text='<%#Eval("msg")%>'/>
</td>
<tr>
</table>
</ItemTemplate>
</asp:ListView>
Here's the java-script
<script type="text/javascript">
function selectedid( id ) {
alert(id);
}
</script>
The alert shows the selected row's id value.I need to pass this id value to .cs file.