Occaisionally our office printer craps out on us in the middle of a print job, or someone just forgets to print because they get interrupted. In the good 'ole days, I built up my response using a StringBuilder and output the contents to the screen and to a log file in case we ever needed to go back and re-print.
Now I'm working with a system that makes use of all the .Net yumminess (Repeaters, page开发者_如何转开发 events, etc) rather than building up the HTML in code. Is there a way for me to log/archive the entire HTML response generated by the server for a particular page (e.g. hook into the Page_Render event and dump the output to a file)?
Thanks, Sam
You can write an Http Module that plugs in at the end of the request pipeline and records the complete output.
See this example that should get you most of the way there.
精彩评论