Using Virtual Folders and Forms Authentication - Strange problem

J

Jerry Morton

Hi,
This is a strange one. I have the following ASP.NET application:

/default.aspx
/login.aspx
/web.config

/bin/myapp.dll

/secure/aCommonSecurePage.aspx
/secure/PageWithNoCodeBehind.aspx
/secure/web.config <- simply denies access to unauthenticated
users


All this WAS under a single web site on my server and worked OK.

However, there are going to be multiple web sites on the server
(differentiated using host-headers, if that's important) and the pages
in the "/secure" folder will be identical for all of them so I thought
I'd put those "/secure" pages in a folder (say "D:\commonpages") and
use a "virtual directory" on each site, all pointing at the same
"D:\commonpages" folder.

However, this "broke" the ASP.NET application in very strange ways! If
I have the "/secure" virtual folder set up as an "application" in IIS,
"aCommonSecurePage.aspx" can't see the "myapp.dll" to execute its
compiled code (I get a "could not load type..." error). I expected
this I suppose. However, if I REMOVE the IIS application and then
browse to "/secure/aCommonSecurePage.aspx", IIS tries to return a
DEFAULT document for the folder, or gives "Directory browsing not
allowed" if there is none! It also TRUNCATES the URL in my browser to
"http://OneOfMySites/secure"!

If I browse to "http://OneOfMySites/secure/PageWithNoCodeBehind.aspx"
(which is exactly as it says (I think!) - just for HTML display only)
- it DOES show the page correctly!

So the virtual folder is set up OK - it just seems to go crazy when it
has to run off and find the dll? I thought that a plain virtual
directory would behave IDENTICALLY to a regular subfolder in the
application. I guess not?

Thanks for any advice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top