473,408 Members | 2,832 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,408 software developers and data experts.

How best implement ASP.NET Forms Authentication?

In my ASP.NET app, I have a few pages that I want to be public (i.e.
accessible by everyone) and the rest private (user has to be signed in). In
the examples I've seen, the public files have been in the root folder with
it's own Web.config file and the private ones in a subfolder with a separate
Web.config file.

Must I necessarily use a subfolder to separate private from public files?
Could I maybe have them all in the same root folder but then perhaps list
the public pages somehow in the Web.config file? I'm just looking for the
best, most standard way to do this.

Thanks,
Ron
Nov 13 '05 #1
2 4700
JKJ
No, you don't have to. Just use a location element within
your web.config. Go here for an example:

http://www.wilsondotnet.com/Code/?pa...ile=Web.config

-----Original Message-----
In my ASP.NET app, I have a few pages that I want to be public (i.e.accessible by everyone) and the rest private (user has to be signed in). Inthe examples I've seen, the public files have been in the root folder withit's own Web.config file and the private ones in a subfolder with a separateWeb.config file.

Must I necessarily use a subfolder to separate private from public files?Could I maybe have them all in the same root folder but then perhaps listthe public pages somehow in the Web.config file? I'm just looking for thebest, most standard way to do this.

Thanks,
Ron
.

Nov 13 '05 #2
Thanks.. that works great. But, would I have to create a locatio section
for every public page or is there a more abbreviated way to do it?

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

Thanks,
Ron
"JKJ" <je**************@mchsi.com> wrote in message
news:05****************************@phx.gbl...
No, you don't have to. Just use a location element within
your web.config. Go here for an example:

http://www.wilsondotnet.com/Code/?pa...ile=Web.config

-----Original Message-----
In my ASP.NET app, I have a few pages that I want to be

public (i.e.
accessible by everyone) and the rest private (user has to

be signed in). In
the examples I've seen, the public files have been in the

root folder with
it's own Web.config file and the private ones in a

subfolder with a separate
Web.config file.

Must I necessarily use a subfolder to separate private

from public files?
Could I maybe have them all in the same root folder but

then perhaps list
the public pages somehow in the Web.config file? I'm

just looking for the
best, most standard way to do this.

Thanks,
Ron
.

Nov 13 '05 #3

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

Similar topics

6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
6
by: Stan | last post by:
We have several intranet ASP.NET web sites. Users log on to the sites by using form authentication and custom security (user names and passwords are stored in the database). If a user logs on to...
3
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be...
2
by: James X. Li | last post by:
Is there a way to implement multiple login forms for ASP.NET applications? With our application we want to implement simple login form for normal resources (downloadable files), but more rigorous...
2
by: Eric | last post by:
I am trying to build an app where the stuff in the root directory is open to all, but anything under the Restricted directory requires you to login and I want to use Forms to do it. I'm having...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
2
by: Svein Erik Storkaas | last post by:
I am about to add security to a web project for the first time, and i'm wondering what the easiest, yet a good way to do this? The page is just for personal use, so it does not need to be "ultra"...
1
by: Mike Moore | last post by:
Does anyone have suggestions on the best way to check if a user is logged into asp.net web application? We are not using forms authentication. We are authenticating our users against active...
2
by: Joey | last post by:
I have a web app with many users and their associated values (hashed passwords, first name, last name, etc...) stored in a Microsoft SQL Server 2000 database. My app uses stored procedures and...
4
by: Ned Balzer | last post by:
Hi all, I am pretty new to asp.net; I've done lots of classic asp, but am just beginning to get my mind wrapped around .net. What I'd like to do is include some code that tests if a user is...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
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...

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.