Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
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 '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
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

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.