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
I get this:
Request object error 'ASP 0101 : 80004005' Unexpected error [my script], line xx The function returned |.
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?
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.
See http://www.asp.net/whitepapers/aspnet4/breaking-changes#0.1__Toc256770154
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.
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
The only thing you can do here is to create another application pool for your asp classic pages and create a new app (aka new virtual directory) for them regarding the new app pool.
As you can't share any application or session scope between asp and asp.net this shouldn't be a problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With