Saturday, February 12, 2011

The gridview fired event RowEditing which wasn't handled

I ran into this problem with the following code:
<asp:TemplateField HeaderText="">
<asp:LinkButton ID="btnCC2" runat="server"
CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id", "{0}") %>'
CommandName="Edit" OnCommand="btnCC_Click">

ASP.NET apparently thinks any control with "Edit" as the CommandName is supposed to be calling the RowEditing function.

To fix this, change CommandName to something else. I changed mine to CommandName="EditCC"

No comments:

Post a Comment

There was an error in this gadget