accessing problem in subwebs

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Hi, I'm getting the following error when I run/debug my application:



Could not load type 'MyApplication.SomeNamespace.SomeClassInNamespace'



To give you more background information I have an application, with the
following folder structure:



MyRootFolder

- MySubFolder



Inside MySubFolder I have a user control that any file inside this folder
calls. This user control has an .ascx file with the Inherits=".." statement
like any user control would. So when I run my application there are no
problems with displaying/running the user control. But then I wanted to
restrict access to that folder (MySubFolder) so I dropped a web.config file
inside it and turned the folder into an application folder/sub web. But when
I do that, I get the 'Could not load type' error message.



Can anyone help me out? Is there some permissions that I need to set?

Thank you.

Peter
 
You cannot load user controls from a different web application. So, when
you made it a web app (by putting in the web.config file), you made it
impossible for MyRootFolder to use controls from MySubFolder.

What I'd recommend is to remove the web.config file and make MySubFolder a
folder again (and not an app). To secure MySubFolder, you can add something
like the following to the web.config in MyRootFolder:
<location path="MySubFolder/*.*"> <-- What is being secured

<system.web>

<authorization>

<allow users="?" /> <-- Change this to the security that
should apply to this folder.

</authorization>

</system.web>

</location>

(I'm not positive about the format of the path in the location node.)

This will let you specify different levels of security for different parts
of your web.

HTH
 
Back
Top