J
Jéjé
Hi,
I want to dynamically load an ASCX control which contain a formview.
And I want to render the result into a string.
but I receive some errors like:
Control 'FormView1' of type 'FormView' must be placed inside a form tag with
runat=server
StringBuilder stringBuilder = new StringBuilder();
StringWriter stringWriter;
HtmlTextWriter htmlTextWriter;
stringWriter = new StringWriter(stringBuilder);
htmlTextWriter = new HtmlTextWriter(stringWriter);
ctl = Page.LoadControl("~/controls/Overview.ascx");
..... some commands here ....
ctl.DataBind();
ctl.RenderControl(htmlTextWriter);
return stringBuilder.ToString();
what can I do?
thanks.
Jerome.
I want to dynamically load an ASCX control which contain a formview.
And I want to render the result into a string.
but I receive some errors like:
Control 'FormView1' of type 'FormView' must be placed inside a form tag with
runat=server
StringBuilder stringBuilder = new StringBuilder();
StringWriter stringWriter;
HtmlTextWriter htmlTextWriter;
stringWriter = new StringWriter(stringBuilder);
htmlTextWriter = new HtmlTextWriter(stringWriter);
ctl = Page.LoadControl("~/controls/Overview.ascx");
..... some commands here ....
ctl.DataBind();
ctl.RenderControl(htmlTextWriter);
return stringBuilder.ToString();
what can I do?
thanks.
Jerome.