SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
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 '11 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 '11 at 12:48
good luck to find the answer – Steve B Jun 27 '11 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 – Jaap Vossers Jul 27 '11 at 17:23

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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