我有带有 LinkButton 和标签的 Datalist。当我单击该数据记录时,我需要获取该记录的主键值。如何做到这一点?
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" OnSelectedIndexChanged="DataList1_SelectedIndexChanged" RepeatColumns="1" ShowFooter="False" ShowHeader="False" Width="587px" style="margin-right: 25px; margin-bottom: 116px">
<ItemTemplate>
<table style="width:100%;">
<tr>
<td>
<asp:LinkButton ID="LinkButton1" runat="server" Font-Bold="True" Font-Names="Tahoma" Font-Size="Medium" Font-Strikeout="False" ForeColor="Black" OnClick="LinkButton1_Click" Text='<%# Eval("title") %>'></asp:LinkButton>
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:Label ID="contentLabel" runat="server" Font-Names="Tahoma" Text='<%# Eval("content") %>' />
</td>
<td>
<br />
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>