473,320 Members | 1,862 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,320 software developers and data experts.

Form authorization problem

Hi, How should I write the web.config file to allow some of the aspx files
be executable to all users and others are required users to login? All the
aspx files are in the same folder.
Nov 18 '05 #1
3 2495
you could use something like this :
<authentication mode="Forms">
<forms name="YourName" loginUrl="login.aspx" protection="All" />
</authentication>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>

<location path="yourpage.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>

This will ask the user for login, but if the user reach yourpage.aspx it
will be allowed to everybody without a login

Regards
Martin

"nick" <nb***@removethis.hotmail.com> wrote in message
news:Om**************@tk2msftngp13.phx.gbl...
Hi, How should I write the web.config file to allow some of the aspx files
be executable to all users and others are required users to login? All the
aspx files are in the same folder.

Nov 18 '05 #2
Thanks, however, after I modified the code, I got the following error:

Server Error in '/calendar' Application.
----------------------------------------------------------------------------
----

Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.

Parser Error Message: Unrecognized configuration section 'location'

Source Error:

Line 71: -->
Line 72: </authorization>
Line 73: <location path="calendar.aspx">
Line 74: <system.web>
Line 75: <authorization>

Source File: c:\inetpub\wwwroot\calendar\web.config Line: 73

"Martin Marinov" <me********@mecrossroad.bg> wrote in message
news:OZ**************@tk2msftngp13.phx.gbl...
you could use something like this :
<authentication mode="Forms">
<forms name="YourName" loginUrl="login.aspx" protection="All" />
</authentication>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>

<location path="yourpage.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>

This will ask the user for login, but if the user reach yourpage.aspx it
will be allowed to everybody without a login

Regards
Martin

"nick" <nb***@removethis.hotmail.com> wrote in message
news:Om**************@tk2msftngp13.phx.gbl...
Hi, How should I write the web.config file to allow some of the aspx files be executable to all users and others are required users to login? All the aspx files are in the same folder.


Nov 18 '05 #3
never mind, the location is at wrong place...

"nick" <nb***@removethis.hotmail.com> wrote in message
news:uB**************@TK2MSFTNGP12.phx.gbl...
Thanks, however, after I modified the code, I got the following error:

Server Error in '/calendar' Application.
-------------------------------------------------------------------------- -- ----

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details
below and modify your configuration file appropriately.

Parser Error Message: Unrecognized configuration section 'location'

Source Error:

Line 71: -->
Line 72: </authorization>
Line 73: <location path="calendar.aspx">
Line 74: <system.web>
Line 75: <authorization>

Source File: c:\inetpub\wwwroot\calendar\web.config Line: 73

"Martin Marinov" <me********@mecrossroad.bg> wrote in message
news:OZ**************@tk2msftngp13.phx.gbl...
you could use something like this :
<authentication mode="Forms">
<forms name="YourName" loginUrl="login.aspx" protection="All" />
</authentication>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>

<location path="yourpage.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>

This will ask the user for login, but if the user reach yourpage.aspx it
will be allowed to everybody without a login

Regards
Martin

"nick" <nb***@removethis.hotmail.com> wrote in message
news:Om**************@tk2msftngp13.phx.gbl...
Hi, How should I write the web.config file to allow some of the aspx files be executable to all users and others are required users to login? All the aspx files are in the same folder.



Nov 18 '05 #4

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...
13
by: david | last post by:
I can not figure out what is the problem that I can protect ASP.NEt form resource but not some other type of files, for example, images. All my aspx forms located in Demo folder and image files...
2
by: sduncansca | last post by:
Hi I have an ASP.NET v1.4 application that uses form based authorization. My authorization section of the web.config looks like <authorization> <deny users="?" /> <allow users="*" />...
3
by: serge calderara | last post by:
Dear all, I clearly underdand the advantage of both type of authentification but is it allowed or possible to set the Authentication mode to Windows and then handle a login form for defined...
5
by: | last post by:
When completing certain types of transactions, the users of my app will need to have the clients sign an authorization form. I want to add a button to the page that allows them to print the auth...
1
by: sonu | last post by:
Mark is creating a website using ASP.NET. He is using Forms authentication for authenticating and authorizing users. He has the following layout of files and directories in his website: Root...
2
by: Gnic | last post by:
Hi, I am a page that sit on a form authentication directory, but I have 1 or 2 pages that don't require form authentication, also I have a web service class in this directory as well, I am...
2
by: nick | last post by:
I have an Asp.Net 2.0 application using form authentication. I want the html pages be protected by the authentication system too. The accessing of html files need to be authenticated in my local...
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.