How to send HLML from a Web Service to a Client Browser

  • Thread starter Thread starter Bas Groeneveld
  • Start date Start date
B

Bas Groeneveld

I have an application where I send an XML dataset to a web service to be
rendered as an html page. This complete html page is returned as a string by
the web service.

How can I then pass this string to the client browser to be displayed?

I have had a look at Response.Write, however this does not create a new
page, rather writes into the html from existing aspx page's postback.

I could save the returned html as a file and then redirect the client to
this new html page using Response.Redirect. However this seems clunky and
would not scale all that well in a multi user environment.

I am sure that I have seen an example of this somewhere (using streams from
memory) but I cannot remember where.

Thanks
Bas Groeneveld

--

==========================================
Bas Groeneveld
Benchmark Design System and Software Engineering
PO Box 165N, Ballarat North, VIC 3350
Phone: +61 3 5333 5441 Mob: 0409 954 501



--

==========================================
Bas Groeneveld
Benchmark Design System and Software Engineering
PO Box 165N, Ballarat North, VIC 3350
Phone: +61 3 5333 5441 Mob: 0409 954 501
 
I think I have just solved it myself:

sHTML = MyWebService(sXML);

Response.Write(sHTML);
Response.End();

The End() member will terminate the Response and ensures that the aspx
postback does not append anything else. The client browser than displays the
page defined in sHTML (which has been derived from the data in sXML).

Is this the best way to do this??

Thanks
Bas
 
Back
Top