Strange Error - When Subfolder is converted to virutal folder

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Let me explain step wise.
1.. I have a site running on port 5555
2.. If contains web.config file with contains <Forms> authentication.
3.. The site contains a sub-folder named "MembersArea" which contains ss.aspx
4.. ss.aspx contains page_load event which prints
Response.Write(Page.User.Identity.Name);
5.. Everything work proper untill here
6.. Now i want to have one more web.config file for folder "MembersArea" , I know i just cannot put web.config file into any sub-folder unless the folder is a "virtual folder"
7.. so i converted the "subfolder" into "virtual folder" from IIS Manager. (Note: I have not yet created any web.config in this subfolder)
8.. Now when i try to execute ss.aspx it throws strange error ... ( you can see the screen dump in the attached file)
9.. The Erorr message is: "Could not load type 'hs.ss'."
10.. When i remove the "virtual folder" it works again.
Can some one tell me what's actuall happening.
 
When you set up another virtual folder, the ASP.NET runtime thinks that you
have an entirely separate ASP.NET application, and any data from the root
application is no longer available to you. In this case, your compiled code
is sitting in the root directory's bin subdirectory, and is not accessible
to the new application that you have created. Just leave it set up to not be
a virtual folder, and you will be fine. Also, you are absolutely able to
override settings in the web.config of your child folders - there are some
settings that are only held at the root level, these settings are inherited,
and you simply override those settings you need modified for a subfolder.
Most commonly, what I do is change access permissions for subfolders in a
child web.config, and leave everything else as the inherited values.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

<Jignesh> wrote in message Let me explain step wise.
1.. I have a site running on port 5555
2.. If contains web.config file with contains <Forms> authentication.
3.. The site contains a sub-folder named "MembersArea" which contains
ss.aspx
4.. ss.aspx contains page_load event which prints
Response.Write(Page.User.Identity.Name);
5.. Everything work proper untill here
6.. Now i want to have one more web.config file for folder "MembersArea" ,
I know i just cannot put web.config file into any sub-folder unless the
folder is a "virtual folder"
7.. so i converted the "subfolder" into "virtual folder" from IIS
Manager. (Note: I have not yet created any web.config in this subfolder)
8.. Now when i try to execute ss.aspx it throws strange error ... ( you
can see the screen dump in the attached file)
9.. The Erorr message is: "Could not load type 'hs.ss'."
10.. When i remove the "virtual folder" it works again.
Can some one tell me what's actuall happening.
 
I have a situation as follows. please suggest what shall i do.
a.. To login into the main site users need passwords. Its simple i have done this using asp.net forms authentication method.
b.. The site has "admin" section. which is to be protected by one more password level. Even if the user tries to access any admin pages directly by typing in url it should ask user "special" password to access pages.
c.. I thought by making it virtual directory i will be able to add web.config file with <authentication> tags for this sub-virtual folder.
But now it seems it will not be possible to do this. can u tell me any other way to implement this?

Regards,
 
Back
Top