Recently I same across this issue of rendering a .apsx pages GridView control in Microsoft Excel spreadsheet. On using the GridView.rendercontrol method I was getting this error
"Control 'gvCustomers' of type 'GridView' must be placed inside a form tag with runat=server."
Fix
just add this method to your .aspx page
public override void VerifyRenderingInServerForm(Control control) { /* Confirms that an HtmlForm control is rendered for the specified ASP.NET server control at run time. */ }