response.Filter problem

S

SushiSean

Hi. I use IHttpModule for my site (asp.net 3.5 and iis 7)
and there i add response.Filter for my pages.

public void Init(HttpApplication application)
{
application.ReleaseRequestState += new
EventHandler(InstallResponseFilter);
}

private void InstallResponseFilter(object sender, EventArgs e)
{
HttpResponse response = HttpContext.Current.Response;
HttpRequest request = HttpContext.Current.Request;
if ("text/html" == response.ContentType && true ==
request.Url.AbsolutePath.EndsWith(".aspx"))
{
response.Filter = new OutputCleanupFilter(response.Filter);
}
}

Where OutputCleanupFilter is my class

public class OutputCleanupFilter : Stream
{
.......

public override void Write(Byte[] buffer, Int32 offset, Int32 count)
{

}
........
}

In that function Write i do link changes in html code.
So the problem is I GOT PAGE BY PARTS. So that fuction got buffer few times
and each time if have near 30% of page and if in that place link cuted by
half i can't parse it. So exist any way to froce send in buffer all page at
the same time?
 

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
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top