https and virtual directories

Discussion in 'ASP .Net' started by Dru Snyder, Mar 15, 2005.

  1. Dru Snyder

    Dru Snyder Guest

    I've never done a login to a website so please bear with me. What is the
    best way to go about this? Do I put all of the pages in a subdirectory that
    I want secured and then put a different web.config file in there to specify
    Forms authentication and deny all users? I tried to do that, but then I get
    this error:

    Parser Error Message: It is an error to use a section registered as
    allowDefinition='MachineToApplication' beyond application level. This error
    can be caused by a virtual directory not being configured as an application
    in IIS.

    So then I went into IIS and made that subdirectory a virtual directory. I
    don't get that error, but no codebehind pages work then. I'm not sure why,
    but then I get this error.

    Parser Error
    Description: An error occurred during the parsing of a resource required to
    service this request. Please review the following specific parse error
    details and modify your source file appropriately.

    Parser Error Message: Could not load type 'realestate.members.WebForm2'.

    Apparently the aspx page can't find the class in it's code-behind page. I
    assume because it is it's own virtual directory and the path to the class
    isn't correct. I've changed it to everything I could think of, but still no
    go.

    If anyone has any suggestions regarding this and possibly a good book that
    deals with asp.net and ssl that would help, I would greatly appreciate it.

    Dru
    Dru Snyder, Mar 15, 2005
    #1
    1. Advertising

  2. Dru Snyder

    Scott Allen Guest

    Hi Dru:

    Back up and put the <authentication> element in the web.config in root
    of your website - you can't use this in a subdirectory. You can use
    the <authorization> element in a subdirectory.

    You also need to undo making the sub-dir a v-dir. ASP.NET will think
    the pages inside are in a different application and will try to load
    compiled code from a bin directory that doesn't exist.

    Make sense?

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/



    On Tue, 15 Mar 2005 11:24:46 -0500, "Dru Snyder" <>
    wrote:

    >I've never done a login to a website so please bear with me. What is the
    >best way to go about this? Do I put all of the pages in a subdirectory that
    >I want secured and then put a different web.config file in there to specify
    >Forms authentication and deny all users? I tried to do that, but then I get
    >this error:
    >
    >Parser Error Message: It is an error to use a section registered as
    >allowDefinition='MachineToApplication' beyond application level. This error
    >can be caused by a virtual directory not being configured as an application
    >in IIS.
    >
    >So then I went into IIS and made that subdirectory a virtual directory. I
    >don't get that error, but no codebehind pages work then. I'm not sure why,
    >but then I get this error.
    >
    >Parser Error
    >Description: An error occurred during the parsing of a resource required to
    >service this request. Please review the following specific parse error
    >details and modify your source file appropriately.
    >
    >Parser Error Message: Could not load type 'realestate.members.WebForm2'.
    >
    >Apparently the aspx page can't find the class in it's code-behind page. I
    >assume because it is it's own virtual directory and the path to the class
    >isn't correct. I've changed it to everything I could think of, but still no
    >go.
    >
    >If anyone has any suggestions regarding this and possibly a good book that
    >deals with asp.net and ssl that would help, I would greatly appreciate it.
    >
    >Dru
    >
    >
    >
    >
    Scott Allen, Mar 15, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeffry van de Vuurst
    Replies:
    2
    Views:
    523
    Jeffry van de Vuurst
    Jul 30, 2003
  2. =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=

    Multiple bin-directories with virtual directories?

    =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=, Nov 9, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    823
    =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=
    Nov 9, 2004
  3. Paul F
    Replies:
    4
    Views:
    629
    Mark Fitzpatrick
    Jun 25, 2008
  4. Dru Snyder

    https and virtual directories

    Dru Snyder, Mar 15, 2005, in forum: ASP .Net Security
    Replies:
    0
    Views:
    96
    Dru Snyder
    Mar 15, 2005
  5. Ron Smith
    Replies:
    5
    Views:
    144
    Michele Dondi
    Nov 2, 2004
Loading...

Share This Page