Here I will explain how to solve the problem Control 'gvdetails' of type 'GridView' must be placed inside a form tag with runat=server during export of gridview to excel or word or csv using asp.net.
Description:
![]() |
public override void VerifyRenderingInServerForm(Control control) { /* Verifies that the control is rendered */ } |
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
Subscribe by RSS
Subscribe by Email
|
|||
|
|
|

Subscribe by RSS
Subscribe by Email
18 comments :
222
Thank you. It solve my problem.
that's good, Thank you.
Thanks. It solved my Problem.
I have used this code but i am getting error like.,
No suitable method found to override
I have used this code in a visual webpart 2010 but i am getting error like
No suitable method found to override
hi man,
I test you code it gives me the following error:
RegisterForEventValidation can only be called during Render();
Line 39: StringWriter sw = new StringWriter();
Line 40: HtmlTextWriter htw = new HtmlTextWriter(sw);
Line 41: gvdetails.RenderControl(htw);
Line 42: Response.Write(sw.ToString());
Line 43: Response.End();
it works. very good. thanks in advanced
that's thank to code for Gridview data into pdf format Venky Mokka
Thank. i have a problem if content in gridview is another language
i tried code.
but i m getting this error.
(RegisterForEventValidation can only be called during Render();
)
how can i fix it...???
public override void VerifyRenderingInServerForm(Control control)
{
/* Verifies that the control is rendered */
}
This Function are not allow for .ascx Control page.
i am trying it but not successfully implimented.
Unable to cast object of type 'iTextSharp.text.html.simpleparser.CellWrapper' to type 'iTextSharp.text.Paragraph'
how to solve it please help me sir
I have also added this but got error. As I have put EventValidation = "false" this code works.
Thank you Suresh.
You have saved my lots of time in googling and getting better code.
Can anybody tell me what was problem with code?
Why do we need to call the function-VerifyRenderingInServerForm()
thanks nice explanation
can any budy tell me how to attach and send mail on single click in asp.net c#