Server.Execute () or Transfer () in classic ASP for aspx defined in Web.config

Server.Execute () or Transfer () to a physical ASPX page from a classic ASP file works with an upgrade to IIS.

Example: In test.asp,

Server.Execute("/test.aspx")

      

However, if the aspx path is defined in the Web.Config to run the handler in the dll, Server.Execute () and Transfer () do not work from a classic ASP file.

Example: In web.config

<add name="test_*" verb="*" path="test.aspx" type="testhttphandler, {fully qualified dll name}">

      

* Note that there is nothing wrong with the way the path is defined in the web.config file. I just want to show an example and I apologize for the formatting.

In test.asp

Server.Execute("/test.aspx") 

      

I am getting the error:

Server object error 'ASP 0228 : 80004005'
Server.Execute Error
/test.asp, line 18
The call to Server.Execute failed while loading the page.

      

I understand that there are many ways to solve this problem, but I would like to understand why this does not work. I personally like to keep things as simple as possible with as few files as possible, so I looked into what I learned above. Let me know if you have any understanding.

Thank!

+3


source to share


1 answer


ASP-Classic (asp.dll) and ASP.Net (aspnet_wp.exe) use different processes and Server.Execute tries to use ASP-Classic interpreter to ... err ... interpret ASP.Net which is not appropriate. Server.Execute tries to "execute" the script using the same process as its: asp.dll.

Server.Transfer to the aspx file is more likely to serve you.



Hope this makes sense.

+1


source







All Articles