简体   繁体   中英

ASP.NET Website inside Webforms application?

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

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).

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.

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?

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM