我有一个gridviewMain。每当我单击第 1 行的关闭链接按钮时,我都想获得值 aa。单击第 2 行上的关闭获取 bb 的值。有任何想法吗。
A B C
aa xx 3 CLOSE
bb yy 4 CLOSE
cc zz 5 CLOSE
aspx
<asp:BoundField DataField="afield" HeaderText="A"
SortExpression="afield" >
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="bfield" HeaderText="B" SortExpression="cfield" >
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="cfield" HeaderText="C" SortExpression="cfield" >
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="lbClose" runat="server" CausesValidation="False" CommandName="CloseClicked" Text="Close"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>