Click here to Skip to main content
14,882,036 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to export grid view in excel having nested grid view ? this is giving erroe given below...


Error giving while exporting in excel : Control 'GridView2' of type 'GridView' must be placed inside a form tag with runat=server.
Posted

Put this in your page's code
C#
public override void VerifyRenderingInServerForm(Control control)
{
   /* Verifies that the control is rendered */
}

I strongly suspect this is the issue. If this don't solve the issue,let me know.

Regards..
   
v2
As mentioned in error description, issue is with your FORM tag. You have to specify runat="server" with FORM tag. Like below:


<form id="form1" runat="server">

Post your code(aspx & cs) if this does not solve your issue.
   
That doesn't nearly a question though. We can't see your code so that we can tell what that error mean.Better follow these links and find solution:
Export Nested GridView data to excel in asp.net[^]
Export Nested Gridview to Excel[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900