UserControl Export GridView to PDF
问题 I have a UserControl and I'm trying to export my GridView table to a PDF. I am able to do a CSV file just fine, but I get errors when trying to do a PDF. (I am using iTextSharp Library) This is the error I'm getting: "Control 'DoNotAddList_1_GridView1' of type 'GridView' must be placed inside a form tag with runat=server." I have a form tag in my html, and I tried adding it in the ascx file but nothing works. I've found many people getting this error and most everyone suggested adding this to