views:

31

answers:

1

I'd like the ability to add a sub "folder" to an MVC area. For instance, I have an area

~/areas/Support

And, in some classic ASP code, I need to refer to an include file

<!-- #include virtual="/Support/_inc/myinclude.asp"-->

Just for grins I tried including a virtual folder /support that points to this virtual folder, but that, of course, overrides the MVC route and keeps the MVC stuff from executing.

Suggestions?

A: 

I've found a solution that seems somewhat unconventional, but is working so far.

Under my test environment (IIS7.5 on Win7 Ultimate 64, ASP.NET MVC2), I edited the config file

c:\windows\system32\inetsrv\config\applicationHost.config

and added virtual folders like so

<virtualDirectory path="/Support/_inc" physicalPath="C:\websites\virt\...\support\_inc" />
<virtualDirectory path="/support/man" physicalPath="c:\websites\http\...\support\man" />
<virtualDirectory path="/support/man/docs" physicalPath="c:\websites\virt\...\support\man\docs" />
<virtualDirectory path="/Support/docs" physicalPath="C:\websites\virt\...\support\docs" />
<virtualDirectory path="/Support/man/_inc" physicalPath="C:\websites\virt\...\support\man\_inc" />

since there is no virtual folder (or real folder, for that matter) at /support, MVC routes that to the /Areas/Support... items. Anything that matches the virtual folders in the application config, however, seem to be routed by IIS before ASP.NET takes over, so they are correctly handled by ASP.

Interesting.

David Lively