I have couple of update panels and jquery tabs on page. And also I am loading couple user controls on update panels. After user waited for couple of minutes (not checked the
I had this issue when I upgraded my project to 4.5 framework and the GridView
had Empty Data Template. Something changed and the following statement which previously was returning the Empty Data Template was now returning the Header Row.
GridViewRow dr = (GridViewRow)this.grdViewRoleMembership.Controls[0].Controls[0];
I changed it to below and the error went away and the GridView started working as expected.
GridViewRow dr = (GridViewRow)this.grdViewRoleMembership.Controls[0].Controls[1];
I hope this helps someone.