Rendering a usercontrol to obtain html output in webservice

Discussion in 'ASP .Net Web Services' started by Choi Han Choong, Aug 18, 2005.

  1. 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.
     
    Choi Han Choong, Aug 18, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chao
    Replies:
    4
    Views:
    1,930
    Mike Treseler
    Jun 14, 2004
  2. Choi Han Choong
    Replies:
    0
    Views:
    1,967
    Choi Han Choong
    Aug 18, 2005
  3. Eric Chan
    Replies:
    1
    Views:
    2,611
    Andy Fish
    Jun 23, 2004
  4. Reik
    Replies:
    1
    Views:
    244
    Brock Allen
    Apr 12, 2005
  5. Choi Han Choong

    Rendering a usercontrol to obtain html output in webservice

    Choi Han Choong, Aug 18, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    115
    Choi Han Choong
    Aug 18, 2005
Loading...

Share This Page