zoukankan      html  css  js  c++  java
  • The GridView 'gv ' fired event RowEditing which wasn 't handled.

         很久没写gridview的事件代码了,刚写了个rowcommand的事件,出现下面的错误:

    The   GridView   'gv '   fired   event   RowEditing   which   wasn 't   handled.  
    Description:   An   unhandled   exception   occurred   during   the   execution   of   the   current   web   request.   Please   review   the   stack   trace   for   more   information   about   the   error   and   where   it   originated   in   the   code.  

    Exception   Details:   System.Web.HttpException:   The   GridView   'gv '   fired   event   RowEditing   which   wasn 't   handled.

    Source   Error:  

    An   unhandled   exception   was   generated   during   the   execution   of   the   current   web   request.   Information   regarding   the   origin   and   location   of   the   exception   can   be   identified   using   the   exception   stack   trace   below.    

    查找原因,发现要加入以下事件RowEditing :

    .aspx:
    <asp:GridView   ID= "GridView1 "   runat= "server "   OnRowEditing= "Editing ">
       <Columns>
         <asp:CommandField   ShowEditButton= "true "   />
       </Columns>
    </asp:GridView>

    .cs:
    protected   void   Editing(object   sender,   GridViewEditEventArgs   e)
    {
      GridView1.EditIndex   =   e.NewEditIndex;

    }

    其他事件,如:Delete,Cancel,Update也是相似的。

    编程技巧也跟工具一样,久久不用,就会生锈。记之~~~

  • 相关阅读:
    Record
    Solution -「洛谷 P6287」「COCI 2016-2017」Mag
    Solution -「洛谷 P3773」「CTSC 2017」吉夫特
    Solution -「SP 106」BINSTIRL
    Record
    Record
    Record
    Solution Set -「CSP-S 2020」
    MDK在SRAM中运行-STM32F103RCT6为例
    STM8S103F3P STVD+COSMIC开发环境搭建
  • 原文地址:https://www.cnblogs.com/huige1004/p/1371633.html
Copyright © 2011-2022 走看看