I'm attempting to do something which should be relatively simple. I'm using a ListView to show a number of items, using the ItemTemplate. Inside the ItemTemplate I have a div surrounding the full item, so that I can highlight on a hover event, (being handled already by jQuery).
What I would like to do is have the click event on the div fire a button to open a details view for that specific item. The problem I'm having is pulling back the ClientID for that button while using jQuery. I've tried the:
$('#<%= Button1.ClientID %>')
route, but that doesn't work, as the Button doesn't exist when the page loads.
The basic code is as follows:
<asp:listview>
<itemtemplate>
<td runat="server">
<div class="container">
<asp:linkbutton id="Button1" runat="server" text="View Details" />
fun and exciting stuff here...
</div>
</td>
</itemtemplate>
</asp:listview>
Any suggestions or help are much appreciated!