When I click on a row in my GridView, I want to go to a other page with the ID I get from the database.
In my RowCreated event I have the following line:
I have the solution.
This is what i have done:
if(e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["onClick"] = "location.href='view.aspx?id=" + DataBinder.Eval(e.Row.DataItem, "id") + "'"; }
I have putted the preceding code in the RowDataBound event.