473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

2 Login pages in web.config = ERROR!

rh
In my web.config file, I added code so that users will be redirected to 1 of
2 Login pages depending on the original page they are trying to access.
However, I get the following error message:

Error 106 C:\Source\MyWebSite\Current\Employees\Main.aspx: ASP.NET runtime
error: 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. (C:\Source\MyWebSite\Current\web.config line 48)
C:\Source\MyWebSite\Current\Employees\Main.aspx 1 1 C:\...\Current\
Below is the part of my web.config file in question. The error does NOT
occur if I comment out the <authentication> element that is located within
the <location> element (but then I don't get the effect I want).

<location path="~/Employees">

<system.web>
<authentication mode="Forms">

<forms loginUrl="~/Employees/Login.aspx"></forms>

</authentication>
<authorization>

<deny users="*" />

<allow roles="Employees" />

</authorization>

</system.web>

</location>
<system.web>

<authentication mode="Forms" >

<forms loginUrl="Login.aspx" />

</authentication>

<system.web>


Jan 23 '06 #1
1 1865
This subweb must be defined as an application in IIS before it can use the
web.config file.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"rh" <rh******@smci.com> wrote in message
news:eU**************@TK2MSFTNGP10.phx.gbl...
In my web.config file, I added code so that users will be redirected to 1
of 2 Login pages depending on the original page they are trying to access.
However, I get the following error message:

Error 106 C:\Source\MyWebSite\Current\Employees\Main.aspx: ASP.NET runtime
error: 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. (C:\Source\MyWebSite\Current\web.config line 48)
C:\Source\MyWebSite\Current\Employees\Main.aspx 1 1 C:\...\Current\
Below is the part of my web.config file in question. The error does NOT
occur if I comment out the <authentication> element that is located within
the <location> element (but then I don't get the effect I want).

<location path="~/Employees">

<system.web>
<authentication mode="Forms">

<forms loginUrl="~/Employees/Login.aspx"></forms>

</authentication>
<authorization>

<deny users="*" />

<allow roles="Employees" />

</authorization>

</system.web>

</location>
<system.web>

<authentication mode="Forms" >

<forms loginUrl="Login.aspx" />

</authentication>

<system.web>

Jan 25 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: David W. Simmonds | last post by:
I have a form that will prompt for a user name/password. In VS.NET, I have the protected form in a folder named Admin. I have a Web.config file in that folder as well. It contains the following...
4
by: 23s | last post by:
I had this problem in the past, after a server reformat it went away, and now after another server reformat it's back again - no clue what's doing it. Here's the flow: Website root is public, no...
4
by: nicholas | last post by:
Hi, Got an asp.net application and I use the "forms" authentication mode defined in the web.config file. Everything works fine. But now I would like to add a second, different login page for...
2
by: Assimalyst | last post by:
Hi, I am creating a website where i want to allow some webforms to be accessible to all users, and those in a subdirectory available only to authenticated users. I have created a script to...
0
by: John | last post by:
Hi When I use the login control to login I get the following error; Parser Error Message: The connection name 'SqlServices' was not found in the applications configuration or the connection...
1
by: Kirk Groome | last post by:
Hi all, I'm working on a web site and I would like to use the VS login controls. The problem I'm having is that when I create a new user all works fine. The user gets added to the database and...
6
by: AppleBag | last post by:
I'm having the worst time trying to login to myspace through code. Can someone tell me how to do this? Please try it yourself before replying, only because I have asked this a couple of times in...
0
by: sandari | last post by:
The following code (web.config in Visual Studio 2005) is supposed to redirect a user to the appropriate Form depending on their role. However, regardless of the user's role, the only page...
10
by: DavidPr | last post by:
When I logout as one user and log in under a different user, it opens with the last user's information. User 1 - Unsername: Davey Jones User 2 - Unsername: David Smith I log out from Davey...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.