I have a simple app that has the following structure
[tt][opsreport]
web.config
clientside.js
styles.css
logon.aspx
default.aspx
summary.aspx
[dataentry]
event.aspx
followup.aspx[/tt]
opsreport is configured as an application virutal directory in IIS. dataentry is just a sub folder.
anyone can access the opsreport directory. Only authenticated users can access the pages in the dataentry directory.
when I click the link to access opsreport/dataentry/event.aspx I get the following error
[tt]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.
It errored on this line of the web.config file
<authentication mode="Forms>[/tt]
I don't think I need to configure each subdirectory as an application. That doesn't make sense.
For testing purposes I did create the dataentry folder as an appliaction in IIS. When I accessed the event.aspx page I was prompted for my username and password. When I clicked Logon I was brought back to the logon page. I know my uid/pwd were OK because if they weren't I would get a message *Invalid Logon*.
I removed the Forms Authentication from the dataentry directory to see what the issue was. Now when I accessed the event.aspx it errored on the first line of the aspx.file
[tt]<%@ Page Language="vb" AutoEventWireup="false" Codebehind="event.aspx.vb" Inherits="opsreport._event" %>
[/tt]
stating it can't find the code for the page.
This might be because there is no bin directory in the dataentry folder. All the code was compiled and placed in the bin directory on the root.
here is my web.config file
What do I need to do, to use forms authentication on a sub directory? Thank you in advance for your help.
Jason Meckley
Database Analyst
WITF
[tt][opsreport]
web.config
clientside.js
styles.css
logon.aspx
default.aspx
summary.aspx
[dataentry]
event.aspx
followup.aspx[/tt]
opsreport is configured as an application virutal directory in IIS. dataentry is just a sub folder.
anyone can access the opsreport directory. Only authenticated users can access the pages in the dataentry directory.
when I click the link to access opsreport/dataentry/event.aspx I get the following error
[tt]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.
It errored on this line of the web.config file
<authentication mode="Forms>[/tt]
I don't think I need to configure each subdirectory as an application. That doesn't make sense.
For testing purposes I did create the dataentry folder as an appliaction in IIS. When I accessed the event.aspx page I was prompted for my username and password. When I clicked Logon I was brought back to the logon page. I know my uid/pwd were OK because if they weren't I would get a message *Invalid Logon*.
I removed the Forms Authentication from the dataentry directory to see what the issue was. Now when I accessed the event.aspx it errored on the first line of the aspx.file
[tt]<%@ Page Language="vb" AutoEventWireup="false" Codebehind="event.aspx.vb" Inherits="opsreport._event" %>
[/tt]
stating it can't find the code for the page.
This might be because there is no bin directory in the dataentry folder. All the code was compiled and placed in the bin directory on the root.
here is my web.config file
Code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<location path="dataentry">
<system.web>
<authentication mode="Forms" >
<forms
name=".opsreport"
loginUrl="../logon.aspx"
protection="All"
slidingExpiration="true"
timeout = "10"
/>
</authentication>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
<system.web>
<compilation defaultLanguage="vb" debug="true" />
<customErrors mode="RemoteOnly" />
<authentication mode="None" />
<trace
enabled="false"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="true"
/>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
</configuration>
What do I need to do, to use forms authentication on a sub directory? Thank you in advance for your help.
Jason Meckley
Database Analyst
WITF