:GridView 一段代码
<asp:TemplateField HeaderText="操作">
<ItemTemplate><asp:LinkButton ID="btn_Del" runat="server" CommandName="gv_Del" CommandArgument='<%# Eval("FID")+","+Eval("FID") %>'
OnClientClick="javascript:return confirm('确定删除该信息?')" CausesValidation="False">删除</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
一个参数写法:CommandArgument='<%# Eval("FID") %>'
传多个参数写法:CommandArgument='<%# Eval("FID")+","+Eval("FID") %>'
后台取值:
GridView 事件
protected void gv_GridView_RowCommand(object sender, GridViewCommandEventArgs e)
{
string[] strId = e.CommandArgument.ToString().Split(',');
}