Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 16th, 2004, 07:02 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aadz5
Default Web.Config

Hi,

is it possible to have web.config files within folders that over-rides the web.config file for the site??



Adz - The World is not enough
__________________
Adz - Learning The J2EE Ways.
 
Old May 16th, 2004, 10:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

Because ASP.NET works with virtual directories, you can have a web.config file at the root of the virtual, but not going into different folders within that virtual directory that I know of. However, depending on what you need it for, certain areas have a location element that you can specify the properties to be set only for that folder.

You also have a machine.config for every machine, which the web config overrides the settings in this file if there are conflicts. The machine.config is in the <windows folder>\Microsoft.NET\Framework\<Framework version>\config folder.

Brian
 
Old May 16th, 2004, 10:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

if u r worry about read/Downloading ur Web.Config its not accessible in HHTP & users can NOT do it!

Always:),
Hovik Melkomian.
 
Old May 16th, 2004, 10:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Yeah, the only way to access the file is someone hacks into your system...
 
Old May 16th, 2004, 02:49 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aadz5
Default

Thanks for the help guys,

I thought as much, ok well I have a web.config file, which points to a specific login page. I want certain people to have specific privlages. At the moment each individual can access anywhere. So for example if you are a User you can only access certain pages, if you are a administrator you can access everything etc. Is there a way of doing this using form auhentication??


Adz - The World is not enough
 
Old May 16th, 2004, 08:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

There is a location element, which as an authorization element, which has an allow/deny element for allowing denying users in the application. YOu need to look at the web.config file xml layout, which I found in the MSDN. Or, you can use authenication in your application using the genericidentity and genericprincipal objects.

Brian
 
Old May 21st, 2004, 03:55 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aadz5
Default

Thats interesting,

So Brian, what the genericidentity and genericprincipal objects. Can these be implemented in place of the web.config file?? My website is with an ISP and they have stated that I cannot use multiple web.config files. thanks for the help guys, I think that I am getting there slowly!

Adz - The World is not enough
 
Old May 21st, 2004, 12:31 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

GenericIdentity and GenericPrincipal are used in application based security. You can use them to represent the user/roles, like below:

Dim objIdentity as new GenericIdentity(strUserName)
Dim objPrincipal as new GenericPrincipal(objIdentity, new string() {"Users", "Power Users"})

You can check if the user belongs to a role that is allowed to use a web form or a web forms actions through the objPrincipal.IsInRole("Power Users") method, which returns a boolean. I wouldn't replace the web.config file; I use these objects in my site to verify that the user can access a page or a page's functionality, but I still use the web.config file for some security related information. It's really a balance between the two.

Brian
 
Old May 24th, 2004, 03:30 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aadz5
Default

Nice one,

thanks Brian, I will give it a go!

Adz - The World is not enough





Similar Threads
Thread Thread Starter Forum Replies Last Post
web.config dpkbahuguna ASP.NET 3.5 Basics 2 August 26th, 2008 09:41 AM
web.config vs. app.config darlo Visual Studio 2005 11 August 20th, 2008 07:23 AM
web.config rrkano .NET Framework 2.0 1 June 23rd, 2008 02:50 PM
I need Help with web.config please ! _fluffy_ BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 January 4th, 2007 05:31 PM
Web Config C# akshay144 VS.NET 2002/2003 0 November 10th, 2006 10:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.