I have been trying to figure out how to allow the user to click a row in a gridview in a master page. Ultimately I want the user to be redirected to another page with a values from the gridview (hiddenfield column) to be the querystring value of the page redirected to.
A this point I can only get to the gridview itself. I cannot get the row or the cell from the gridview.
<script type="text/javascript">
$(document).ready(function () {
$('[id$=LeagueGV]').click(function() { alert('gridview clicked'); });
//window.location = "/League_Admin.aspx?LID=" + $(this).find('LeagueHidden').value();
//});
});
</script>
<asp:GridView runat="server" ID="LeagueGV" DataKeyNames="LeagueID" >
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:HiddenField runat="server" ID="LeagueHidden" Value='<%# Eval("LeagueID") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label runat="server" ID="LeagueIDLabel" Text='<%#Eval("LeagueID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="LeagueName" HeaderText="League Name" />
</Columns>
</asp:GridView>