zoukankan      html  css  js  c++  java
  • gridview行按钮事件

    前台

     <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>&nbsp;&nbsp;
                             <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>&nbsp;&nbsp;
                             <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());
                   。。。。。            }
            }

  • 相关阅读:
    基督山伯爵---大仲马
    数据结构
    11. 标准库浏览 – Part II
    python 标准库
    Python 官方文件
    Python 函数
    学员名片管理系统
    如何进入多级菜单
    Python 文件操作
    Python 字符串 (isdigit, isalnum,isnumeric)转
  • 原文地址:https://www.cnblogs.com/tongdengquan/p/6090595.html
Copyright © 2011-2022 走看看