Article ID: 815152 - Last Review: August 18, 2003 - Revision: 1.7 HOW TO: Use ASP.NET to Protect File TypesOn This PageSUMMARYThis step-by-step article describes how to add additional
file types to an ASP.NET application to protect certain file types. By default,
ASP.NET is configured to intercept and to stop requests for several different
file types that are used in ASP.NET applications. These file types are ones
that must not be retrieved by users. These file types include .config files
that store configuration information for the application and .cs files that
store the source code of the application. ASP.NET ensures the privacy of these
files by associating both file types with System.Web.HttpForbiddenHandler.
System.Web.HttpForbiddenHandler returns an error to the user who requests the
file. This method of protecting files can be used for any file type. This
method is useful for protecting files that exist in the folder of the Web
application and must never be retrieved by users. Edit Script Mappings in Internet Services ManagerMicrosoft Internet Information Services (IIS) 5.0 determines how to handle requests based on the script mapping for the file name extension of the request. These script mappings are adjusted by using Internet Services Manager. For ASP.NET to block file types, you must first configure IIS 5.0 to forward those requests to ASP.NET. To do this, follow these steps:
Configure a File Type That You Want BlockedTo block additional file types for an ASP.NET application, follow these steps:
REFERENCES For additional information, click the following article
numbers to view the articles in the Microsoft Knowledge Base: 315736
(http://support.microsoft.com/kb/315736/EN-US/
)
HOW TO: Secure an ASP.NET Application by Using Windows Security
315588
(http://support.microsoft.com/kb/315588/EN-US/
)
HOW TO: Secure
an ASP.NET Application Using Client-Side Certificates
818014
(http://support.microsoft.com/kb/818014/
)
HOW TO: Secure Applications That Are Built on the .NET Framework
| Article Translations
|

Back to the top
