The problem is probably due to the fact that the .jpg extension is not mapped to asp.net by default and is being processed by IIS.
If you are using IIS7, you can change this by setting the runAllManagedModulesForAllRequests parameter to true.
<system.webServer> <modules runAllManagedModulesForAllRequests="true"> ... </modules> </system.webServer>
If this event is not already fired, you can try changing global.asax as
<%@ Application Language="C#" %> <script runat="server"> public override void Init() { this.BeginRequest += new EventHandler(global_asax_BeginRequest); base.Init(); } void global_asax_BeginRequest(object sender, EventArgs e) { } </script>
If you want to process only .jpg files, it is better to make an HTTP handler and configure system.webServer> handlers and system.web> httpHandlers on the Internet. config to run this handler for .jpg requests.
Jan Remunda
source share