| |

VerySource

 Forgot password?
 Register
Search
View: 849|Reply: 3

CommandField issue in asp.net2.0GridView

[Copy link]

2

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-4 14:10:01
| Show all posts |Read mode
I used the paging stored procedure to bind the GridView, and the binding was normal, and added
 <asp: CommandField ShowEditButton = "True" />
Edit the button, but this button will go wrong at the time of testing. The following is a hint of the error. I really do n’t understand and do n’t know where the problem is.
/ ************** The following is an error prompt ********************** /
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
Reply

Use magic Report

0

Threads

64

Posts

35.00

Credits

Newbie

Rank: 1

Credits
35.00

 China

Post time: 2020-1-4 14:57:01
| Show all posts
Give your gv_mstr a new event handler method name in the properties window, or delete it.
Reply

Use magic Report

0

Threads

21

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-1-4 15:45:01
| Show all posts
Add the following code to the post code, of course this sentence just gets the line you edited correctly.


 Protected Sub GridView1_RowEditing (ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridView1.RowEditing

        Dim grv As GridViewRow = GridView1.Rows (e.NewEditIndex)

    End Sub
Reply

Use magic Report

0

Threads

21

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-1-4 15:57:01
| Show all posts
Or your code contains an event name of 'gv_mstr', but you cannot find a method with an event name of 'gv_mstr' in the later code.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list