Groups | Blog | Home
all groups > asp.net > february 2005 >

asp.net : Is there a way to intercept page HTML source before it's served


Peter Rilling
2/18/2005 9:29:31 PM

[quoted text, click to view]

Peter Rilling
2/18/2005 9:29:55 PM
Could you inherit and override some of their methods?

[quoted text, click to view]

Matt Berther
2/18/2005 9:48:39 PM
Hello lp,

I think you probably want to look at the HttpResponse.Filter [1] property.
This is a Stream derived class that you can hook up to do whatever you need
with the response stream prior to it being sent to the client. Here [2] is
an example.

[1] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebHttpResponseClassFilterTopic.asp
[2] http://dotnetjunkies.com/WebLog/donnymack/archive/2003/09/08/1468.aspx

Enjoy!

--
Matt Berther
http://www.mattberther.com

[quoted text, click to view]


LP
2/18/2005 11:58:37 PM
Hi,

After html of .aspx page has been generated, but before it has been sent to
a client, I want to interecept it, and slightly modify it. I can't find
anyway to get html of a page. How can I do that? I need that because I need
to modify behaviour of a component that someone else wrote, but I don't have
its sourcecode. Thanks

Lau Lei Cheong
2/19/2005 1:50:06 PM
For example: use Page.render() to get the rendered HTML source then modify
it and send it out by Response.write()... on PreRender event?

Not very sure about that.

"Peter Rilling" <peter@nospam.rilling.net> ¦b¶l¥ó
news:O9q7ZQkFFHA.392@TK2MSFTNGP09.phx.gbl ¤¤¼¶¼g...
[quoted text, click to view]

Robbe Morris [C# MVP]
2/19/2005 3:18:49 PM
This articles demonstrates a variety of ways to intercept http
requests and do things with them and to them. Do a page
search on the word: FilterHtml

http://www.eggheadcafe.com/articles/hijacksession.asp

--
2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.mastervb.net/home/ng/forumvbcode/post10017013.aspx
http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp



[quoted text, click to view]

AddThis Social Bookmark Button