The GridView ' ' fired event RowUpdating which wasn't handled. C# code behind asp.net

后端 未结 2 1047
名媛妹妹
名媛妹妹 2021-01-23 07:51

There are similar questions on Stackoverflow and other websites, but I seem to miss something.

I have a GridView bound to a DataTable which comes from a database. My goa

相关标签:
2条回答
  • 2021-01-23 08:17

    GridView's in ASP.NET have some built in commands - Deleted, Update, etc. What's happening is that your button has a command name of Update, and the Gridview is hijacking that from you and firing a RowUpdating event instead of your RowEditing event. Change your button command name to be Edit, and use a RowEditing event.

    0 讨论(0)
  • 2021-01-23 08:29

    If you are using the Row_Command event to edit, then don't use the button command name "Update" for Update and "Delete" for Delete. Instead, use Edit or UP and Del respectively.

    0 讨论(0)
提交回复
热议问题