IIS 6
Global.asax Events in IIS 6 and IIS 7 for Static Resources
Submitted by Ben Hodson on Wed, 06/16/2010 - 15:30
A quick and easy way of doing URL rewriting or responding to requests for static resources is to use the Application_BeginRequest event. This event will fire each time a page is requested. In there, you could do something like the following to serve a different file when a specific URL is requested to your site:
// get the current URL string sUrl = Request.Url.PathAndQuery; if (sUrl == "/my-pretty-url/some-page") {
Popular Articles
Last viewed:
- GridView ObjectDataSource LINQ Paging and Sorting
- Tutorial for Configuring Silverlight 4, Entity Framework and WCF RIA Services in Separate Component Assemblies (DLL’s)
- ASP.NET CSS Highlight TextBox on Focus
- Fixing Relative Paths in C# ASP.NET When Using Url Rewriting
- Launch URL in Default Browser using C#
- Clustered Index vs. Non-Clustered Index in SQL Server

Recent comments
14 hours 51 min ago
1 day 14 hours ago
3 days 15 hours ago
4 days 5 hours ago
4 days 15 hours ago
4 days 21 hours ago
5 days 1 hour ago
1 week 22 hours ago
1 week 1 day ago
1 week 4 days ago