Calling ASP.net from Classic ASP

时光毁灭记忆、已成空白 提交于 2019-12-24 03:43:30

问题


I am new to ASP and ASP.net.

I have just started working on a legacy ASP classic project and been given a sample that makes a remote call in ASP.net.

Is it possible to call the ASP.net page from ASP?

Are you they compatible.

My impression so far is that they aren't compatible, but perhaps. I'm wrong.

I mean the .net project could be called with parameters and kept seperate I guess?

Does anyone have any experience with similar problems or have any tips they can share?


回答1:


You can create a COM wrapper for an asp.net dll, for example, see this article.

If you just want to have two side-by-side applications that can share information, this is probably easier. Cookies are cookies - you can pass session info between them with a cookie as long as both apps understand the format (and they are running in the same domain). The asp.net Session data may not be easily available to traditional asp (as the other answer notes) but nothing's forcing you to use asp.net sessions to track your users. You can always just create your own session keys, put them in a cookie of your choosing that both applications know about, store them in a database, and use them as you need. As long as both apps have access to the same database and understand the format of the cookies, no problem.

The old asp application probably already does something like this, just copy the same model into the asp.net app.




回答2:


There's no easy way, the best I've seen is a "session transfer" similar to this, which at least allows you to keep a user logged in and transfer all the login variables between Classic and .Net. It can take a while to transfer though...

Bear in mind though, that ASP's idea of a session ID, and ASP.Net's are VERY different indeed...

http://www.eggheadcafe.com/articles/20021207.asp



来源:https://stackoverflow.com/questions/5456908/calling-asp-net-from-classic-asp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!