Parser Error - Could not load type

G

Guest

Hi peeps

Ok, I've got a web application running (lets call it MyApp, so its namespace
is MyApp). I've created a subdirectory within this application called
"secure", and made than an Application in IIS too. Plus I've added another
web.config in there.

Then I added an aspx page (called UpdateLogin.aspx), which created itself in
the namespace "MyApp.secure", but when I try to load this page im getting...

"Parser Error Message: Could not load type 'MyApp.secure.UpdateLogin'."

Here's the line it's failing on...

<%@ Page language="c#" Codebehind="UpdateLogin.aspx.cs"
AutoEventWireup="false" Inherits="MyApp.secure.UpdateLogin" %>

All files are there, have tried taking out ".secure" from the namespace and
the reference, have tried adding the directory to the Codebehind option, but
all to no avail.

What's going on?

Cheers


Dan
 
S

Scott Allen

Hey Dan:

You probably do not want the secure subdirectory to be an application.
..NET will assume it has it's own bin directory and is looking for a
dll in secure\bin to find the code for the aspx file.
 
G

Guest

Ok, thats cool. But the web.config file (code below) said it needed to be an
application, hence. This web.config overwrites parts of the web.config in the
main app directory.

I can I get round it wanting to be an application?

Cheers


Dan

\secure\web.config...

<configuration>
<system.web>
<authentication mode="Forms">
<forms
name="ADupdateAuth"
path="/"
loginUrl="UpdateLogin.aspx"
protection="All"
timeout="30"
/>
</authentication>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>
 
S

Scott Allen

Does the main web site use a different authentication mechanism, like
Windows authentication?

If not, you can specify the specific sub directories to protect using
the inside a <location> element.
 
G

Guest

Yes it does. The main system using Windows Authentication. I'm try to create
a system to allow the user to update his/her Active Directory info (address,
tel, etc), but obviously I want them to login proper for that (security!).
Hence the directory, web app and web.config file.

Is there any way to make it work though? :)
 
S

Scott Allen

Well, you could just force them to login with thier windows account
using windows authentication. In that case you wouldn't need an
<authentication> element in the sub directory, but just an
<authorization> element to keep out anonymous users and only allow in
authenticated users. Know what I mean?
 
G

Guest

Hmm... they've just logged into Windows and the Intranet app comes up, so we
wnted to avoid having to enter their password again.

So I've got the main app set to Deny unknown users, and use IWA/Windows
Auth. That means they don't have to login for the main app.

That's not really the problem is it. The problem is I cannot create an aspx
within that directory. I put one in there that I created and then moved into
the dir, and that works fine. So there must be a way of adding a file to a
directory and making it work.
 

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

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top