前台
<asp:TemplateField HeaderText="操作">
<ItemTemplate>
<asp:Panel ID="panel_delete" runat="server">
<img src="../../images/admin/detelIcon.gif" />
<asp:LinkButton ID="LinkButton_Delete" runat="server" CausesValidation="False" CommandName="Delete" Text="删除" OnClientClick='<%#Eval("ranking_class_chinese_name","return confirm(/"确定删除:{0} ?/")")%>'></asp:LinkButton>
<img src="../../images/admin/editIcon.gif" />
<asp:LinkButton ID="LinkButton_select" runat="server" CausesValidation="False" CommandName="Select" Text="编辑"></asp:LinkButton>
</asp:Panel>
<asp:Panel ID="panel_update" runat="server" Visible="false">
<img src="../../images/admin/detelIcon.gif" />
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="UpdateScore" Text="更新" CommandArgument='<%# ((GridViewRow) Container).RowIndex %>'></asp:LinkButton>
<img src="../../images/admin/editIcon.gif" />
<asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" CommandName="CancelingEdit" CommandArgument='<%# ((GridViewRow) Container).RowIndex %>' Text="取消"></asp:LinkButton>
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
后台
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "CancelingEdit")
{
int index = int.Parse(e.CommandArgument.ToString());
。。。。 }
if (e.CommandName == "UpdateScore")
{
int index = int.Parse(e.CommandArgument.ToString());
。。。。。 }
}