intrader wrote:
> On Thu, 25 Aug 2005 13:25:49 -0700, lisa wrote:
>
>
>>Can I do this?
>>
>>I'm playing with AJAX, and it occurred to me that it'd be a lot easier
>>to make changes to a control on the server, grab the HTML that control
>>would now render, and return that to the client, where Javascript could
>>just use outerHTML to replace the whole control.
>>
>>The obvious catch is generating that HTML.
>>
>>I tried making an HTMLTextWriter and doing control.Render(writer), but
>>that gave me an error.
>>
>>I don't want to override the Page's Render method, because I want to
>>make this fairly self-contained. Just stick it in a helper function in
>>a helper class, basically.
>>
>>And after banging my head against it for a few days, I thought I'd ask
>>if anyone knows (a) how to do it, or (b) whether it can be done.
>>
>>Thanks muchly,
>>Lisa
>
> I have not tried it, but you should be able to instantiate a control and
> ask it to render to a stream.
>
> What I have done requires overridint the Render method. There you should
> create a StreamBuffer which you use to create an HTMLTextWriter, then you
> tell the base to render itself, and voila, you have the HTML in the
> StreamBuffer.
>
>
Lastly OuterHTML is not available on Firefox. It's a Web browser.

Just so you know.