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

  • 相关阅读:
    uniapp 画圆形或多边形雷达图
    uniApp开发之公用配置文件common.js
    FastAdmin 表格排序
    fastadmin SelectPage field显示多个字段
    PHP装饰器模式
    PHP原型模式,(理解:创建并初始化对象,再复制一个对象避免重复初始化)
    PHP设计模式-观察者模式
    为什么 echo 3 . print(2) . print(4) . 5 . 'c'的结果是45c2131
    PHP数组式访问接口ArrayAccess用法分析
    浏览器兼容性问题总结
  • 原文地址:https://www.cnblogs.com/tongdengquan/p/6090595.html
Copyright © 2011-2022 走看看