ASP.NET网站内Web表单应用程序? [英] ASP.NET Website inside Webforms application?

查看:107
本文介绍了ASP.NET网站内Web表单应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经继承了一个ASP.NET网站。我们已经转换它为不同的原因,一个Web应用程序。

We've inherited an ASP.NET website. We've already converted it to a web application for different reasons.

但也有2个文件夹,里面是做一些真正的东西缺憾2 .aspx页(创建了其背后对应的code上新建一个aspx文件,并保存它里面的那些文件夹中的一个)。

But there are 2 folders with 2 .aspx pages inside that do some really kludgy things (creates a new aspx file with its corresponding code behind and save it inside one of those folders).

所以,当该项目是一个简单的网站,这工作,因为在运行时创建的页面被请求时编译。这是不适用的web应用程序。

So when the project was a simple website, that worked because the created pages on runtime were compiled at request. This is not applicable to a web application.

我们没有时间重新code那些丑陋的页面,并做到这一点,因为它应该。那么,有没有办法有从项目并在该在的要求编制了网站排除了那些2页(和生成的,在运行时的)?你能想到的有什么其他办法?

We don't have time to re-code those ugly pages and do it as it should. So, is there a way to have those 2 pages (and the generated-at-runtime ones) excluded from the project and inside a website that is compiled at request? What other alternatives could you think of?

推荐答案

您可以在单个站点的多个Web应用程序通过指定它们作为单独的IIS虚拟目录中单独的应用程序。对于这一点,只是在IIS中创建一个新的虚拟目录,右键单击并转到属性。在虚拟目录选项卡上,单击创建。这将指定的虚拟目录作为一个单独的应用程序。

You can multiple Web Applications on a single site by designating them as separate applications within separate Virtual Directories in IIS. For this, just create a new Virtual Directory in IIS, right-click and go to Properties. Under the "Virtual Directory" tab, click Create. This will designate that Virtual Directory as a separate application.

最终的结果将是mysite.dom / VirtualDirectory1和mysite.dom / VirtualDirectory2将是甚至可以在不同的ASP.NET运行时运行单独的应用程序。

The end result will be that "mysite.dom/VirtualDirectory1" and "mysite.dom/VirtualDirectory2" will be separate applications that can even run under a different ASP.NET runtime.

编辑补充的这个缺点是,这两个应用程序是完全独立的,不能共享Session或应用程序信息。这可以通过一个数据库或者其他数据存储可以轻松解决。

EDIT TO ADD that the downside of this is that the two applications are completely separate and cannot share Session or Application information. This can be easily solved via a Database or some other data store.

这篇关于ASP.NET网站内Web表单应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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