473,395 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

OutputStream

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
--
oh please help me
Nov 18 '05 #1
2 1652
> 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.

"knuckleswanny" <kn***********@discussions.microsoft.com> wrote in message
news:88**********************************@microsof t.com... 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
--
oh please help me

Nov 18 '05 #2
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)

"knuckleswanny" <kn***********@discussions.microsoft.com> wrote in message
news:88**********************************@microsof t.com...
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
--
oh please help me

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Richard | last post by:
I'm working on a site that creates mailing labels. When a label is generated, two things happen in the background with the image. First, it is saved as a smaller low-quality .gif on the server...
1
by: Neil Woodvine | last post by:
***Scenario ... I have a DataList with a hyperlink WebControl in the Item Template. I want to display a 64x64 image in the Hyperlink and set the NavigateURL to the full size image. ***Source...
3
by: Zoury | last post by:
Hi folks ! :O) I'm trying to show a PDF in ASP.NET but I can't get to work properly. here's a portion of my code : '** Dim ms As MemoryStream =...
1
by: Tim Menninger | last post by:
When I use the XslTransform.Transform method to write to the HttpRequest.OutputStream The first byte of the output is always an invalid character, looks like an ascii zero or some other...
6
by: Joseph | last post by:
Hi! I have this webpage that contains some panels and buttons. I also want to output an Image to that same page, but when I save the image to the OutputStream using the Image.Save...
0
by: brrrdog | last post by:
Whenever I write to Response.Outputstream after doing a plain response.write, I get a delimiter between the two writes that is made up of three extended ascii chars (decimal equivalents 239,...
3
by: Jenny | last post by:
Hi all, I'm using a second page to write dynamical generated images into the outputstream. This avoids using tmp-files on disc. My code-behind in the start aspx file is: 'Use second file to...
11
by: Random | last post by:
I have tried all the Response methods I can think of (WriteFile, BinaryWrite, OutputStream) to write the byte array of a pdf file to the response. The result looks like it's trying, it comes up as...
7
by: barney.b | last post by:
Hi, Is there a wrapper class, or combination of classes, that will allow me to do the following: class Wrapper extends java.io.OutputStream { public void...
3
by: kellygreer1 | last post by:
PHP will alllow you to build up an entire page and before sending that out as the response.... you can grab all the text and do search and replaces, add comments, make more CSS/XHTML compliant,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.