System.Web.HttpException in asp.net mvc 2 on images and javascript files


System.Web.HttpException in asp.net mvc 2 on images and javascript files



Hi I am getting the following errors reported by ELMAH on my asp.net mvc 2 site for javascript files, images etc.

System.Web.HttpException: The remote host closed the connection

I have done some research and it appears that the user/bot is clicking a link on the site before the page has fully loaded. Now this error never occurs on a controller action but always on a file that is on disk. e.g.

/Content/CmsImages/logo.png /Content/CmsImages/MemberImages/Photo-001605.jpg /Content/jquery.tickertype.js 

So this means that all static files are being routed through the mvc pipeline.

What options do I have?


Trying to read FormsAuthentication tickets to read in other areas of site

1:

Configuration and Views
You could define routes to ignore files in the Content folder.. C# and ASP.NET MVC: Using #if directive in a view
RouteTable.Routes.IgnoreRoute("{folder}/{*pathInfo}", new { folder="content" }); 
How do I get my asp.net MVC application to recognize the stylesheet on the live server?

68 out of 100 based on 43 user ratings 678 reviews

^