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

  • 相关阅读:
    asp.net常用的javascript经典例子
    Silverlight学习之——布局系统
    TreeView数据绑定方法
    软件测试:单元测试的一些疑问
    Silverlight学习之——Deep Zoom文件格式概述
    把生活节奏调整得慢一点
    20、Windows内核函数(1)Windows驱动开发详解笔记,字符串
    24、Windows派遣函数(2)Windows驱动开发详解笔记,直接读写方式
    21、Windows内核函数(2)Windows驱动开发详解笔记,文件操作
    27、Windows内核编程,IRP的同步(1)
  • 原文地址:https://www.cnblogs.com/tongdengquan/p/6090595.html
Copyright © 2011-2022 走看看