Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hey I am getting an error while trying to use Form authentication. It is it erroring out in the web.conf file giving this Parser Error Msg

 

"It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level."

 

<?xml version="1.0" encoding="utf-8" ?>
<!-- Web.Config Configuration File -->
<configuration>
   <location path="clientAdmin">
     <system.web>
        <authorization>
           <deny users="?"/>
        </authorization>
     </system.web>
  </location>
  <system.web>
       <customErrors mode="Off"/>
	<authentication mode="Forms">
		<forms name=".ASPXCLIENT" loginUrl="clientAdmin/login.aspx" protection="all" timeout="20" />
	</authentication>
  </system.web>
</configuration>

 

It has the error at the <authentication mode="Forms"> line. Let me know if you can help. Thanks

  • Administrators
Posted

Is the folder containing the web.config configuered as a virtual director in IIS? If not it needs to be.

Also IIRC you can only set the authentication mode in the applications root directory - if you are trying to do this in a sub-dir then that will also cause this error.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
Is there anyway i can do it without configuring IIS. I think i understand what you are trying to say but not quite. Right now the files files that are trying to run are located in wwwroot/demo/clientAdmin/........what can i do to properly setup this.
Posted
I am simply trying to keep my website organized. I want to keep all pages having to deal with client administration in a folder and so on with other items. The client administration folder needs to be authenicated to access any documents in that folder. This is the object I am trying to achieve. I have setup a simple test to try to simulate this action. I have a file outside the clientAdmin folder that has a link to a file inside the clientAdmin folder. According to what i have read on forms authentication, it should require the login page to be displayed and thus authenticate the user before displaying any page within the folder.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...