这是我的网格:
<asp:GridView ID="gvBatters" runat="server" DataKeyNames="playerID"
AutoGenerateColumns="False">
<Columns>
<asp:HyperLinkField DataTextField="nameFull" HeaderText="Player"
NavigateUrl="~/Pages/individualPlayer.aspx" />
<asp:BoundField DataField="g" HeaderText="G" />
<asp:BoundField DataField="avg" HeaderText="AVG" />
<asp:BoundField DataField="obp" HeaderText="OBP" />
<asp:BoundField DataField="slg" HeaderText="SLG" />
<asp:BoundField DataField="ops" HeaderText="OPS" />
<asp:BoundField DataField="rc" HeaderText="RC" />
<asp:BoundField DataField="h" HeaderText="H" />
<asp:BoundField DataField="doub" HeaderText="2B" />
<asp:BoundField DataField="trip" HeaderText="3B" />
<asp:BoundField DataField="hr" HeaderText="HR" />
<asp:BoundField DataField="rbi" HeaderText="RBI" />
</Columns>
</asp:GridView>
我想将带有超链接字段的数据键名“playerID”传递给 individualPlayer 页面。我更喜欢不使用查询字符串,所以我认为必须有一种方法可以使 datakeyname 成为会话变量。然后我可以使用该变量来满足我的需要,不需要查询字符串。我只是想不出该怎么做