I need a way in vb.net in code behind Page_Load to search the text of the complete page that will be rendered to the browser. For instance, on Page_Load I want to seach for all occurances of the word “test” that are in the page’s document. The word “test” may be in the html on the page or even in a javascript block. I need to search the complete document. I’m using .NET 4.0, VS 2010 and webforms.
Thanks in advance!
Bob
In page_load, the page isn’t composed yet. Try to override the page’s Render method. You can get the text to be rendered there
Edit: here’s an example on how to do it: http://www.west-wind.com/weblog/posts/2004/Jun/08/Capturing-Output-from-ASPNet-Pages