I have a design of JQuery calling a .ashx file returning a small table, which was working fine all this time. However, suddenly the http handler seems to be returning the whole html page instead, not everytime though.

Not sure why this is happening! Any clues?

Thanks in advance

  • 2
    I bet the content of the result page is an error page... can you dump the result ? did you tried to open the ashx file and its argument direclty within the browser ?
    – Steve B
    Jun 27, 2011 at 10:53
  • Thanks. I tried to open the ashx and it seems to work fine. The handler has a try catch block to catch any error, so the .ashx should return a custom error message. There seems to be no ULS logs also showing any errors. And the most important part is that this doesnt happen all the time. It works intermittently :(
    – user3374
    Jun 27, 2011 at 12:48
  • good luck to find the answer
    – Steve B
    Jun 27, 2011 at 13:05
  • As Steve said, get your hands on the "extra" html returned by the handler. Use a tool like Fiddler to monitor what is returned by the handler Jul 27, 2011 at 17:23

1 Answer 1


If the target ashx throws an exception, you be redirected to error.aspx page. Its content type is text/html, not the expected content.

According the comments, I suggest you to review you ashx to find the actual exception, maybe wrapping the Process method of you handler with a try/catch where you can log any unexpeced exception.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.