I have a C#/ASP.net GridView that is contained within a UserControl. The way I have it now, gridview will have an onrowclick attribute added on as follows:

```
protected void _gridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
  e.Row.Attributes["onclick"] = Page.ClientScript.GetPostBackClientHyperlink(this.GridView, "EditRow$" + e.Row.RowIndex);
}

```

However, I get an invalid postback error due to EventValidation when this click event occurs. Also, I have buttons on the row that use GridViewRowCommands to redirect to other pages. Unfortunately, I can't get both to work together either (the RowCommand function never gets run). 

For example, this is the handler I would use:

```
protected void _gridView_RowCommand(object sender, GridViewCommandEventArgs e)
{
   if (e.CommandName.ToString() == "EditRow" && e.CommandArgument.ToString() == "0")
      Response.Redirect(anotherURL);
   if (e.CommandName.ToString() == "BACK" && e.CommandArgument.ToString() == "0")
      Response.Redirect(thisURL);
}

```

And this is a button I use on the row:

```
<asp:Button ID="_AddButton" runat="server" CommandName="BACK" CommandArgument="0" Text="Add" />

```

Ideally, the row-onclick will use this GridViewRowCommands as well so I can have the handling of the redirection all in one place. However, I'm not sure how to go about this. Any suggestions as to a better approach?

Thanks for your continued support!