locked
HttpHandler Stopped Working RRS feed

  • Question

  • User-428068715 posted

    I use several HttpHanders in my ASP.Net Web. Some of these handlers are .ashx files while others are in C# class libraries. At some point all of these stopped working. I did a "Diff" on my web.config file to see what had changed. No changes I saw stood out as a problem.

    How exactly do I track down why these handlers stopped working?

    Thursday, July 10, 2008 4:28 PM

Answers

  • User-428068715 posted

    I finally found what was causing the problem! I implemented ScrewTurnWiki code in my web app. In the global.asax, Application_BeginRequest method there was code:

    if (ext.Equals("ashx"))

    {

    // Demand the request to Default.aspx

    HttpContext.Current.RewritePath("~/Default.aspx?Page=" + pageName + qs);

    }

    Since ScrewTurnWiki uses .ashx, I just have to find a way to make all this work together.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, July 12, 2008 11:48 AM

All replies

  • User481221548 posted

    Hi NickKA

    How do that indicates, that it stop working?
    Some eror message or fail behavior there?

    Thursday, July 10, 2008 6:42 PM
  • User-428068715 posted

    Some of these handlers displayed an image stored in the database. The image no longer displays and the code is never called if I set a breakpoint in the code. No exception is generated.

    Thursday, July 10, 2008 6:56 PM
  • User481221548 posted

    Hi

    And whats displayed on the webbrowser instead?
    Any transfer to see on Fiddler?

    Thursday, July 10, 2008 7:40 PM
  • User-428068715 posted

    Well, in the case of the image a red X is displayed. I don't understand your question about Fiddler.

    Thursday, July 10, 2008 7:56 PM
  • User481221548 posted

    Hi NickKA

    I mean, whats happend if you open the ImageUrl directly on your browser.
    Fiddler:

    Thursday, July 10, 2008 8:28 PM
  • User-967720686 posted

    Hi NickKA,

    I guess you are using a class that implements IHttpHandler to create images from database dynamically. If this is the situation please check if the mapping of image files (.jpg, .gif) whichever you are using is there in the IIS. If mapping is not there for then please do the following to map the extension.

    1.    Open the IIS Manager.

    2.    View the Web site or virtual folder properties.

    3.    Click the Directory tab, and then click Configuration.

    4.    On the Mappings tab of the Application Configuration dialog box, click Add.

    5.    In the Add/Edit Application Extension Mapping dialog box, add an association for the image file extension to the aspnet_isapi.dll file, in your case .jpg / .gif / .png / .bmp (one that you are using for dynamic images) You can copy the executable path from the .aspx file. Deselect the Check That File Exists check box. Then click OK.

     

     

    Thursday, July 10, 2008 8:47 PM
  • User-428068715 posted

    I am using Visual Studio.Net 2008. The web is a File system web and it is currently under development so I am running it from the VS2008 IDE not deploying it to IIS yet.

    As I said, this all worked and now it doesn't with no changes to the .ashx files or the class the implements IHttpHandler. There have been changes to the web.config but I don't know what changes may have affected this, if any. I just need to know how to track this down.

    Thursday, July 10, 2008 9:04 PM
  • User-428068715 posted

    I tested setting the ImageUrl to an image on the drive instead of an .ashx and it works perfectly. The .ashx is not being called and I don't kow why.

    Friday, July 11, 2008 9:06 AM
  • User-428068715 posted

    I tried Fiddler, first running the file system web from the development server and second deploying to my local IIS server.

    Fiddler showed nothing that was of any help. It never showed any sessions for "localhost". Here is the sessions it showed:

    # Result Protocol Host URL Body Caching Content-Type Process User-defined 
    4 200 HTTP CONNECT urs.microsoft.com:443 0   iexplore:4792  

     

    # Result Protocol Host URL Body Caching Content-Type Process User-defined 
    7 204 HTTP g.microsoft.com /_0sfdata/1?aa=0:02:20:51&ab=531&ac=119&ad=0&ae=98&af=21&ag=242&ah=0&ai=16&aj=100&ak=0&al=5&nr=2&cg=%7bb3bb5bba-e7d5-40ab-a041-a5b1c0b26c8f%7d 0 no-cache, must-revalidate  Expires: Fri, 01 Jan 1990 00:00:00 GMT  iexplore:4792 

    I'm not sure what the calls are to microsoft, but I didn't see anything about the ashx and my problem.

    Friday, July 11, 2008 1:42 PM
  • User481221548 posted

    Hi

    Again: I mean, whats happend if you open the ImageUrl directly on your browser?

    Friday, July 11, 2008 7:15 PM
  • User-428068715 posted

    I get a Page Not Found Error.

    Friday, July 11, 2008 7:24 PM
  • User481221548 posted

    Hi

    How are the (non *.ashx) Handlers mapped in web.config?

    Friday, July 11, 2008 8:00 PM
  • User-428068715 posted

    The CaptchaType.ashx is a class library handler that worked at one time and no longer works. Other handlers have been added along the way and possibly may be the cause of the problem. See any problems?

    <
    httpHandlers>
    <add verb="*" path="atlasbatchcall.axd" type="Microsoft.Web.Services.MultiRequestHandler" validate="false"/><add verb="*" path="atlasglob.axd" type="Microsoft.Web.Globalization.GlobalizationHandler" validate="false"/>

    <add type="PeterKellner.Utils.CaptchaTypeHandler" verb="GET" path="CaptchaType.ashx"/><add verb="*" path="*.asbx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>

    <remove verb="*" path="*.asmx"/>

    <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

    <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

    <add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

    </httpHandlers>

    Saturday, July 12, 2008 10:02 AM
  • User481221548 posted

    Hi there

    Try using (verb="*") instead of "get".

    Saturday, July 12, 2008 11:09 AM
  • User-428068715 posted

    I finally found what was causing the problem! I implemented ScrewTurnWiki code in my web app. In the global.asax, Application_BeginRequest method there was code:

    if (ext.Equals("ashx"))

    {

    // Demand the request to Default.aspx

    HttpContext.Current.RewritePath("~/Default.aspx?Page=" + pageName + qs);

    }

    Since ScrewTurnWiki uses .ashx, I just have to find a way to make all this work together.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, July 12, 2008 11:48 AM
  • User1956385013 posted

    Dear All

    No strictly related, but in your post I noticed you had used Fiddler and it had returned the following line:

    200 HTTP CONNECT urs.microsoft.com:443

    Does anyone know what this means and whether it is important or not?

    I am developing a SharePoint environment and I've been using Fiddler to test how many requests are being sent to the clients browser. On PLT 2, there are around 50-60 requests being made but around 20 of these (30%!) are the above. I'm thinking, if I can reduce the number of these, things could potentially download much faster.

    Any help would be very grately appreciated.

    Many thanks
    Daniel

    Monday, March 2, 2009 6:34 AM