问题描述
我有一个现有的ASP.NET Web应用程序,我正在转换为MVC 1.0。该网站开始了一个目标。然而,随着时间的推移,我们的赞助商正在要求更多的功能,很明显,由于新的要求,MVC将是我们的最佳路线。在过去的几个月里,我已经在MVC中玩过,并且很好地把握了这一切。我现在遇到的问题是,我们现有的Web应用程序的肉体广泛使用了只有在ASP.NET WebForms中工作的第三方工具。我正在处理的解决方案是在服务器上运行两个Web应用程序。一个应用程序将是我们现有的WebForms应用程序,仅用于公开上述第三方工具的功能。另一个应用将是我们的主要门户网站,将作为新的网站。当用户希望与第三方工具交互时,我希望能够在将用户链接到其他应用程序的适当视图上加载iFrame,然后允许他们与WebForms站点进行交互。这听起来很疯狂吗?
我现在遇到的第一个问题是如何配置我的解决方案,使MVC应用程序与WebForms应用程序通信。每次运行解决方案时,都会为两个应用程序分配一个不同的端口号,我无法弄清楚如何正确配置iFramesrc属性。当然,我无法将WebForms应用程序添加到我的MVC应用程序的参考文献中,所以我被弄坏了!
任何帮助将不胜感激...
如果端口问题是唯一的问题,您可以在固定的虚拟应用程序下的IIS中运行它们。
但是,ASP.NET开发服务器还具有将端口修复到特定号码的功能,而不是每次都随机化。
I have an existing ASP.NET web application that I'm converting to MVC 1.0. The site started out with one goal. However, over time our sponsors are asking for more functionality and it is obvious that MVC would be our best route due to the new requirements. I've dabbled in MVC over the last couple of months and have a pretty good grasp on it all works. The problem that I'm faced with now is that the meat of our existing web application makes extensive use of a 3rd party tool that only works within ASP.NET WebForms.
The solution that I'm working on is to have two web applications running on the server. The one application would be our existing WebForms app and is solely used to expose the above mentioned 3rd party tool's functionality. The other application will be our main portal that will act as the new site. When the user wishes to interact with the 3rd party tool, I want to be able to load an iFrame on the appropriate Views that links the user to the other application and will then allow them to interact with the WebForms site. Does this sound crazy?
The number 1 problem that I'm faced with right now is how to configure my solution make the MVC application talk to the WebForms application. Every time I run the solution, a different port number is assigned to the two applications and I can't figure out how to configure my iFrame "src" properties correctly. Of course, I can't add the WebForms application to my MVC applictions' References, so I'm stumped!
Any help would be greatly appreciated...
If the port issue is the only problem, you can run both of them in IIS under a fixed virtual application.
But the ASP.NET development server also has the feature to fix the port to a specific number and not randomize it each time.
这篇关于如何使用MVC和WebForms配置和调试Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!