Jeffri Alfred Jeffri Alfred - 1 year ago 122
ASP.NET (C#) Question

Export gridview to pdf c# web form

I have some problems to export gridview to pdf.

First , it shows error message

Control 'ContentPlaceHolder1_GVAttendance' of type 'GridView' must be placed inside a form tag with runat=server.

and then I tried to googling and find these codes,

public override void VerifyRenderingInServerForm(Control control)
/* Verifies that the control is rendered */

but it show error message again

Error 5 'My.Project.Control' is a 'namespace' but is used like a 'type'

How can i fix it?

Answer Source

Try Replacing the above code like this

public override void VerifyRenderingInServerForm(System.Web.UI.Control control)
        /* Verifies that the control is rendered */

Hope this works.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download