OutputStream

G

Guest

I have a situation where I need a control that was created specifically for
asp.net to also display in classic asp. The steps I've taken so far is to
extend the control, override Render(HtmlTextWriter writer) and do something
like this:

protected override void Render(HtmlTextWriter writer)
{
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter htw = new HtmlTextWriter(sw);
base.Render(htw);
<psuedo-code> cache sb.ToString();
base.Render(writer);
}
My actual question is, is it possible to get a handle on the applications
HtmlTextWriter object as opposed to creating my own? Because for some
reason, when I use my own HtmlTextWriter guy, I'm not getting all of the
Control's output.
I've tried using the this.Page.Response.Output and OutputStream guys but I'm
unable to access them.
Any help would be HUGELY helpful.
tia
sean
 
K

Kevin Spencer

My actual question is, is it possible to get a handle on the applications
HtmlTextWriter object as opposed to creating my own?

It is passed as a parameter to the function.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
B

bruce barker

on an aspx page, the HtmlTextWriter is wrapping pipe between the asp.net and
and the iis asp.net filter that run in the iis server.

your approach is mostly correct, you need to create writer that you pass to
render method, convert to string, then Response write. but you need to
deduce how the control works better. you may need to call init, prerender,
and if it creates child controls, call the render on them. you cource you
will need to do your own event wiring.

The Response object in asp is a common object and the Output stream is a com
stream not a .net. if you wrote a .net stream wrapper for a com stream
object (should be hard), then you could wrap the Response output stream with
com stream wrapper, then wrap that with an htmlwriter stream.

-- bruce (sqlwork.com)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,037
Messages
2,570,371
Members
47,013
Latest member
JewellChes

Latest Threads

Top