在集成管道中运行的经典 ASP [英] Classic ASP running in Integrated Pipeline

查看:10
本文介绍了在集成管道中运行的经典 ASP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将一个经典的 asp 应用程序(我知道,我很幸运)迁移到一个混合的 asp.net/asp 站点,我似乎无权访问 Request.Form 集合.作为一个测试,我这样做了:

I'm migrating a classic asp app (I know, lucky me) to a mixed asp.net/asp site, and it seems like I don't have access to the Request.Form collection. Just as a test, I did this:

for each x in Request.Form 
    Response.Write("<br>" & x & " = " & Request.Form(x)) 
next 

我明白了:

请求对象错误ASP 0101:80004005"意外的错误[我的脚本],第 xx 行函数返回 |.

如果我将应用程序池从集成管道切换到经典代码,则代码可以工作,但在经典模式下运行不是 .net 应用程序的选项.我的未来有解决方法吗?

If I switch the App Pool from Integrated Pipeline to Classic the code works, but running in classic mode is not an option for the .net app. Is there a workaround in my future?

推荐答案

经典asp中访问Request.Form时出现Unexpected错误是因为托管代码模块或handler接触了请求体,之后原生代码无法使用那个.

The Unexpected error when accessing Request.Form in classic asp is because a managed code module or handler has touched the request body, and it's not available to native code after that.

参见 http://www.asp.net/whitepapers/aspnet4/break-changes#0.1__Toc256770154

托管 HTTP 模块读取实体主体的某些部分.例如,一个模块读取 Request.Form 或 Request.Params.这会导致 POST 请求的实体主体被读入托管内存.因此,实体主体不再可用于在 IIS 7 或 IIS 7.5 集成模式下运行的任何本机代码模块.

A managed HTTP module reads some part of the entity body. For example, a module reads Request.Form or Request.Params. This causes the entity body of the POST request to be read into managed memory. As a result, the entity body is no longer available to any native code modules that are running in IIS 7 or IIS 7.5 Integrated mode.

如果您可以控制托管模块,而不是让管道继续使用经典的 asp 处理程序,请使用带有额外 http 标头的 Server.TransferRequest,您可以在下次执行模块时检查该标头.请参阅此答案 https://stackoverflow.com/a/18078054/2837402

If you are in control of the managed module, instead of just letting the pipeline continue to the classic asp handler, use Server.TransferRequest with an extra http header that you can check for next time your module is executed. See this answer https://stackoverflow.com/a/18078054/2837402

这篇关于在集成管道中运行的经典 ASP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆