Click here to Skip to main content
15,889,879 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
Hello,

HtmlForm frm = new HtmlForm();
pg.Controls.Add(frm);
frm.Attributes.Add("runat", "server");
frm.Controls.Add(panelmain);
pg.DesignerInitialize();
pg.RenderControl(htmlWrite);

panelmain is asp:panel control which i need to print inside the panel.. This panel resides in child  page (content place holder).. in this child page i am also using jquery datatable for search and filtering for gridview (gridview is inside the panel - so, i need to print panel)

when i debug frm.Controls.Add(panelmain); , i am getting error error like follow

Additional information: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

But if i remove,  the follow jquery datatable script, the print works.

$('#<%=grdorders.ClientID%>').dataTable({

..

..

});

how to solve this problem?
Posted
Comments
Rajesh Pandya 2-Dec-15 7:44am    
Instead of "#<%=grdorders.ClientID%>" use static id and then try. May be it works.

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