Intercepting page output...

S

Stu

Hi,

I am trying to grab the page output so I can do some html processing before
the page is sent to the browser.

I found a post somewhere which suggests that this would grab the page
content immediately before it is sent to the browser. I have added this to
the page but the sub is not called.

Does anyone know how to get this going?

Protected Overloads Sub Render(ByVal writer As HtmlTextWriter)
If (Page.IsPostBack) Then
Dim sb As New StringBuilder
Dim swr As New StringWriter(sb)
Dim hwr As New HtmlTextWriter(swr)
Render(hwr)
End If
End Sub

Thanks in advance,

Stu
 
B

Brock Allen

Look at setting the HttpResponse.Filter property. This is supposed to allow
you to intercept the response stream after render but prior to sending the
response to the client.
 

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,994
Messages
2,570,223
Members
46,814
Latest member
SpicetreeDigital

Latest Threads

Top