GridView中CommandField问题

elorwang 2007-01-01 04:56:40
我用了分页存储过程绑定GridView,绑定很正常,并加上了
<asp:CommandField ShowEditButton="True" />
编辑按钮,但测试的时候一点这个按钮就会出错,下面是出错的提示,我实在看不懂,不知道问题出在哪里.(好像一定要用Gridview自带的DataSource才行)
/**************以下是错误提示**********************/
The GridView 'gv_mstr' 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_mstr' 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.

Stack Trace:


[HttpException (0x80004005): The GridView 'gv_mstr' fired event RowEditing which wasn't handled.]
System.Web.UI.WebControls.GridView.OnRowEditing(GridViewEditEventArgs e) +324
System.Web.UI.WebControls.GridView.HandleEdit(Int32 rowIndex) +60
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +705
System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +214
System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +244
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3837


...全文
596 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
elorwang 2007-01-01
  • 打赏
  • 举报
回复
问题就是这样的,手动加上上述函数就OK.已解决.
mijikee 2007-01-01
  • 打赏
  • 举报
回复
我觉得是缺少Gridview1_RowEditing函数。如果gridview 的datasource控件中含有了editcommand的话,是不需要RowEditing方法的。

16,722

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧