G
Guest
Hi,
I have a GridView control in page called eventslisting which is inheriting
from a MasterPage. The normal code to export to GridView does not work and
gives me an error - "Control of type GridView must be placed inside form tag
with runat = server". I understand that this is because my Masterpage has the
formtag and not the eventslisting page.
As a workaround I programatically created an HTML form, added runat=server
attribute to it and then added the gridview to it programatically as
frm.Controls.Add(dgTemp);
But I get the same error - "Control of type GridView must be placed inside
form tag with runat = server". when I perform the step
dgTemp.RenderControl(htmlWrite);
Please advise of any solution to this problem that might work.
Thanks,
I have a GridView control in page called eventslisting which is inheriting
from a MasterPage. The normal code to export to GridView does not work and
gives me an error - "Control of type GridView must be placed inside form tag
with runat = server". I understand that this is because my Masterpage has the
formtag and not the eventslisting page.
As a workaround I programatically created an HTML form, added runat=server
attribute to it and then added the gridview to it programatically as
frm.Controls.Add(dgTemp);
But I get the same error - "Control of type GridView must be placed inside
form tag with runat = server". when I perform the step
dgTemp.RenderControl(htmlWrite);
Please advise of any solution to this problem that might work.
Thanks,