Welcome to Webhost4life Forum Sign in | Join | Faq

ASP.NET VB.NET

Started by freek at 06-18-2007 7:30 PM. Topic has 3 replies.

Print Search
Sort Posts:    
   06-18-2007, 7:30 PM
freek is not online. Last active: 6/20/2007 2:42:26 AM freek

Not Ranked
Joined on 06-19-2007
Posts 1
web.config problems...
Reply Quote
i have a web.config file in my admin folder. right now it protects the files but not the directory. it wont redirect back to the login page, i gives a "directory listing denied" error. it also dosen't like to protect .txt files.

any ideas...?
   Report 
   05-28-2008, 2:11 PM
DeveloperBarn is not online. Last active: 7/22/2008 2:02:50 AM DeveloperBarn

Top 10 Posts
Joined on 05-29-2008
Reston, VA
Posts 24
Re: web.config problems...
Reply Quote
Post the content of your web.config file so we may help you troubleshoot.
Jason
Founder, DeveloperBarn Forums
http://www.developerbarn.com

No longer a WebHost4Life Customer
   Report 
   05-28-2008, 2:50 PM
deanman is not online. Last active: 10/11/2008 2:19:42 AM deanman

Top 10 Posts
Joined on 04-11-2007
Posts 187
Re: web.config problems...
Reply Quote
Forms authentication -- which can be handled from within the web.config file --, applies only to ASP.NET files (.aspx etc.)!

In order to protect non-ASP.NET files -- such as '.txt' files etc. --, on IIS 6, you have to register those file extensions and their related handler in IIS. You can do that from you control panel (Set Script Map). Then, you have to write some code (the handler) to detect access to those files and to take the appropriate actions such as blocking.

Beginning with IIS 7, you can handle that stuff from within your 'web.config'.

Note: Special ASP.NET folders (App_Code etc.) and files (.aspx etc.) are protected by design and there is no special need to protect them.
I <3 WebHost4Life.com
   Report 
   05-28-2008, 2:59 PM
DeveloperBarn is not online. Last active: 7/22/2008 2:02:50 AM DeveloperBarn

Top 10 Posts
Joined on 05-29-2008
Reston, VA
Posts 24
Re: web.config problems...
Reply Quote
You can protect entire directories and the files within using web.config:

http://msdn.microsoft.com/en-us/library/6hbkh9s7(VS.80).aspx
Jason
Founder, DeveloperBarn Forums
http://www.developerbarn.com

No longer a WebHost4Life Customer
   Report 
Webhost4life Fo... » General Discuss... » ASP.NET VB.NET » Re: web.config problems...

Powered by Community Server, by Telligent Systems