473,796 Members | 2,788 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forms-based authentication

Hi everybody:
I'm trying to use forms-based authentication in my web application and it
works quite fine when I put web.config file in the root of my web directory.
But this results that all users make to login into the site which is not
desired. Obviously there are some parts in the root of the web directory
which must be allowed to public users. Actually I want a specific folder like
"Admin" be protected merely. When I put the web.config file inside the Admin
Directory (and put another regular web.config file with <authenticati on
mode="Windows" /> tag on the root ) then I got this error when trying to
reach my files inside the Admin directory:
It is an error to use a section registered as allowDefinition ='MachineToAppl ication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.<<


could anybody help please to fix this issue? thanks a lot

Kash
Feb 28 '06 #1
2 1222

web.config applies for the whole site, so you can't "move it around".

In web.config you can specify different authentication for different
folders with:

<location path="Secure" >

<system.web>

<authorizatio n>

<deny users="?" />

</authorization>

</system.web>

</location>

http://weblogs.asp.net/hernandl/arch...formsauth.aspx
Kash wrote:
Hi everybody:
I'm trying to use forms-based authentication in my web application and it
works quite fine when I put web.config file in the root of my web directory.
But this results that all users make to login into the site which is not
desired. Obviously there are some parts in the root of the web directory
which must be allowed to public users. Actually I want a specific folder like
"Admin" be protected merely. When I put the web.config file inside the Admin
Directory (and put another regular web.config file with <authenticati on
mode="Windows" /> tag on the root ) then I got this error when trying to
reach my files inside the Admin directory:
It is an error to use a section registered as allowDefinition ='MachineToAppl ication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.<<


could anybody help please to fix this issue? thanks a lot

Kash

Feb 28 '06 #2
John
thanks for your comments. I did exactly what you're saying here and also
downloaded the folder from the blog page and tried to follow it up row by
row. When I replaced the :
<authorizatio n>
<deny users="?" />
</authorization>

with

<authorizatio n>
<allow users="*" /> <!-- Allow all users -->
</authorization>

but contained it between <location path="backoffic e" > tags at the end of
the web.config, now the authentication feature doesn't work and everyone has
access to backoffice without login! What's wrong with it? Please note that
the "backoffice " directory is right on the root of the web directory.
thanks for your help again

Kash

"John Bailo" wrote:

web.config applies for the whole site, so you can't "move it around".

In web.config you can specify different authentication for different
folders with:

<location path="Secure" >

<system.web>

<authorizatio n>

<deny users="?" />

</authorization>

</system.web>

</location>

http://weblogs.asp.net/hernandl/arch...formsauth.aspx
Kash wrote:
Hi everybody:
I'm trying to use forms-based authentication in my web application and it
works quite fine when I put web.config file in the root of my web directory.
But this results that all users make to login into the site which is not
desired. Obviously there are some parts in the root of the web directory
which must be allowed to public users. Actually I want a specific folder like
"Admin" be protected merely. When I put the web.config file inside the Admin
Directory (and put another regular web.config file with <authenticati on
mode="Windows" /> tag on the root ) then I got this error when trying to
reach my files inside the Admin directory:
It is an error to use a section registered as allowDefinition ='MachineToAppl ication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.<<


could anybody help please to fix this issue? thanks a lot

Kash

Mar 3 '06 #3

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

Similar topics

2
3803
by: Greg Bacchus | last post by:
Hi, I'm getting an exception that really has me stumped. It's sporadic at best, it's only happened a handful of times. This particular time it happened when the user pressed 'Alt-S' to save the data that they were entering. Following is all exception information. Any thoughts much appreciated. Cheers
19
4111
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate the code that implements managing unbound controls on forms given the superior performance of unbound controls in a client/server environment. I can easily understand a newbie using bound controls or someone with a tight deadline. I guess I need...
3
2289
by: Joshua Russell | last post by:
Hi, Both the methods below open up a windows form called MasterForm. However, one works better than the other. Method 1 opens the form correctly but I don't have any reference to the instance of master form. Method 2 opens the form but when I right click on the Notify Icon I don't get the context menu that I should be seeing. I can interact with the main form window but I cannot interact with the NotifyIcon. Method 2 gives a object reference...
7
2479
by: Mike Bulava | last post by:
I have created a base form that I plan to use throughout my application let call the form form1. I have Built the project then add another form that inherits from form1, I add a few panel controls each with a couple of controls in them I then rebuilt my project and my new panels and all controls they contained are gone... I've looked through the Auto generated code but don't see anything that looks wrong Any body have any idea why this...
13
5583
by: MD | last post by:
I have been converting a program from VB6 to VB.Net and enhancing it as well. All has been progressing OK although its been hard work. Now, all of a sudden, when I try to execute a ShowDialog() on one of my forms I get "An unhandled exception of type 'System.ExecutionEngineException' occurred in system.windows.forms.dll". I can't work out what has caused this, and can't find any help on the Microsoft site or anywhere else on the web. ...
15
2066
by: Joshua Kendall | last post by:
I have a script in which it keeps opening the same form instead of only one instance. I also need help with a form that has a password. Where do I put the actual password? can I use a database for multiple users? opens multiple instances of password form instead of one: Public Class Splash Inherits System.Windows.Forms.Form
3
1645
by: Lloyd Sheen | last post by:
I have the following situation: Need a user resizable user control. After much trying with user control I came across the idea of hosting the controls in a form marked as not TopLevel = false. This work fine for most cases, allowing the user to resize the form (and controls within the form. The forms them selves are create dynamically when the user drags a node from a listview to a panel (contained in a Usercontrol which is hosted by...
8
2740
by: Stephen Rice | last post by:
Hi, I have a periodic problem which I am having a real time trying to sort. Background: An MDI VB app with a DB on SQL 2000. I have wrapped all the DB access into an object which spawns a thread to access the database and then displays a modal dialog which allows the user to cancel the task, if it is taking longer than they want, and shows them a display of how long the query has been running so far.
3
2376
by: Geraldine Hobley | last post by:
Hello, In my project I am inheriting several forms. However when I inherit from a form and add additional subroutines and methods to my inherited form I get all sorts of problems. e.g. I sometimes get MyVarialble is not declared errors when the variable is quite clearly declared, when I change it to public and then back again to private the error goes away!!! Also I get lots of member not found errors, these however don't stop me from...
21
3390
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters a zipcode that is unknown this form will open. I don't want users to modify any of this customers data until they close the zipcode form. Normally this can accomplished using a modal form, however this prevents me from opening a new copy of...
0
10459
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10018
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7553
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6795
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.