IIS7 处理程序 - 如何获取返回的页面内容?
我有一个简单的 IIS7 处理程序,可以在页面上插入一些文本。我想要做的是获取根据请求返回的正常页面内容。我已经查看了所有 HttpContext 方法,但找不到任何内容。我可以这样做:
context.Response.Write("<H1>This is a Test.</H1>");
这会替换通常加载的内容。如何将正常内容加载到变量中,然后将其显示在变量下面?
预先感谢您的帮助!
注意:我是通过处理程序而不是标准 ASP.NET 页面来执行此操作。
I've got a simple IIS7 Handler that inserts some text on the page. What I'm looking to do is get the normal page content that would be returned on a request. I've reviewed all the HttpContext methods but was not able to find anything. I can do:
context.Response.Write("<H1>This is a Test.</H1>");
This replaces the content that would normally load. How can I get the normal content loaded into a variable and then display that underneath this?
Thanks in advance for any help!!!
NOTE: I'm doing this through a handler, not a standard ASP.NET page.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您想要使用的是 HttpResponse.Filter,如下所示: http://msdn.microsoft.com/en-us/library/system.web.httpresponse.filter.aspx
I think what you want to use is HttpResponse.Filter, as demonstrated here: http://msdn.microsoft.com/en-us/library/system.web.httpresponse.filter.aspx