C
Choi Han Choong
Hi,
Would like to know if what I am trying to do is possible.
I have a usercontrol(ascx) that basically contains a datagrid.
I would like to save the output of this usercontrol to a file when a
webservice method is called.
I tried with the following but it does not seems to work. Nothing is
rendered.
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
Dim uc as New UserControl
uc.LoadControl("~/Controls/Report.ascx")
uc.RenderControl( hw)
Return tw.ToString
It seems the datagrid is not init or loaded. Even if I called
uc.BindData before call to render, the grid does not seems to get init.
Is what I am trying to do possible? If not any other way to get what I
wanted to do?
Thanks.
Would like to know if what I am trying to do is possible.
I have a usercontrol(ascx) that basically contains a datagrid.
I would like to save the output of this usercontrol to a file when a
webservice method is called.
I tried with the following but it does not seems to work. Nothing is
rendered.
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
Dim uc as New UserControl
uc.LoadControl("~/Controls/Report.ascx")
uc.RenderControl( hw)
Return tw.ToString
It seems the datagrid is not init or loaded. Even if I called
uc.BindData before call to render, the grid does not seems to get init.
Is what I am trying to do possible? If not any other way to get what I
wanted to do?
Thanks.