Tuesday, February 15, 2011

How to solve problem "GridView must be placed inside a form tag with runat=server"

This one happens when try to export gridview to an Excel file.
Direct solution: Override VerifyRenderingInServerForm
Add following code to your page

public override void VerifyRenderingInServerForm(Control control)
{
return;
}

Another solution is:
Use a blank page for the exporting

No comments:

Post a Comment