GridView ItemCommand中取某行某列的值方法,这里提供两个常用的:
一、用CommandArgument属性取值页面如下:
<asp:TemplateColumn HeaderText="图片名称"> <ItemTemplate> <asp:LinkButton ID="btnDownload" runat="server" CommandName="Download" CommandArgument='<%# Eval("IMG_SAVE_NAME") %>' ><%# Eval("IMG_NAME")%></asp:LinkButton> <asp:TextBox ID="Text1" runat="server"></asp:TextBox> </ItemTemplate> </asp:TemplateColumn>