I came across a very interesting error while using buttons/link buttons in the Grid View for editing the Grid View rows data.The exact situation I faced is like this – I have a Grid View with a column which contains an edit button.The button is associated with the Command Name property as “Edit”.

rowupdating event is-32

Some other Grid Views reserved key words and their default associated events are as follow : “Cancel” – Raises the Row Canceling Edit event.

“Delete” – Raises the Row Deleting and Row Deleted events. “Page” – Raises the Page Index Changing and Page Index Changed events.

“Select” – Raises the Selected Index Changing and Selected Index Changed events. “Update” – Raises the Row Updating and Row Updated events.

The simplest solutions for this error is : Just change the “Command Name” property of the “Edit” button from “Edit” to “Edit Row”(or something else which is relevent to you but make sure it is not “Edit”). After scratching my head for sometime I found that the words like “Edit” are reserved to invoke some built in functionality of the Grid View.

So when we use these special key words as the Command Name for the buttons in the Grid View, they automatically invoke the built in functionality of the Grid View when we click on the button.

As our code does not handle those events hence they throw an exception.

So when we change the Command Name property of the buttons to some other text then it will work fine.

Then in the code behind I have handled the On Row Command event.

In the event handler function I have checked for the Command Name property and write necessary code for each of the actions.

The HTML code for the Grid View is as follow : The event handling code for the Row Command event is as follow: protected void gd Test_Row Command(object source, Grid View Command Event Args e) { if (e. Trim() == "Edit") { //Code for the editing } } Till now everything looks fine but the problem arises when you run this application.

When you click on edit button of the Grid View a Javascript error occurs : “Microsoft JScript runtime error: Sys. Page Request Manager Server Error Exception: The Grid View ‘gd Test’ fired event Row Editing which wasn’t handled.” At first look you may think that you have not handled some events fired by the Grid View. The mystery behind this error is the property “Command Name”.