How to troubleshoot this following error:
Control '' of type 'GridView' must be placed inside a form tag with runat=server.
We face regular this kind of error while we are trying to convert gridview into Excel (xls) or other file format. Even we have gridivew control inside form tag.
Above error image from CODE BEHIND.
Above error image from browser yellow page.
Solution:
Add following lines in same code behind where gridview code written.
- public override void VerifyRenderingInServerForm(Control control)
- {
-
- }
It will solved your error.
For more detail reference about this error refer following refer: