I have an ASP.NET Forms application, Framework version 4.5, IIS 7.5 in Windows 2008 Server R2 Standard. Sporadically I get a blank page(screenshot below). When I reset the website in IIS the problem gets fixed.. but then happens again in 2/3 days. Web.config file contains "default.aspx" on top as the default document.
In my application, default.aspx is an empty file that gets created on applications start-up - doesn't contain any code/content in it. My guess is that IIS keeps the blank page in cache and delivers the blank page sometimes. All other pages in the solution are virtual pages without physical existence. However, hitting other URLs loads the contents correctly.
I have already made the following attempts that did not solve the problem:
- IIS output caching - Prevent all caching for both user-mode and kernel-mode.
Added following code block in Global.asax in order to fix the issue to load default document
protected void Application_BeginRequest(Object sender, EventArgs e) { var app = (HttpApplication)sender; if (app.Context.Request.Url.LocalPath.EndsWith("/")) { app.Context.RewritePath(string.Concat(app.Context.Request.Url.LocalPath, "default.aspx")); } }
Can someone come up with some clue? Thanks in advance :)