jquery.ajax returns content-type "html" on iis while it returns content-type "json" on local host

Posted by Sridhar on Stack Overflow See other posts from Stack Overflow or by Sridhar
Published on 2010-06-07T16:16:52Z Indexed on 2010/06/07 16:22 UTC
Read the original article Hit count: 131

Filed under:
|

Hi,

I am using jQuery.ajax function to make an ajax call to a page method in asp.net. I specifically set the content-type to "application/json; charset=utf-8". When I looked at the response in the firebug it says the content-type is html.

Following is the code to my ajax call

 $.ajax({
            async: asyncVal,
            type: "POST",
            url: url + '/' + webMethod, 
            data: dataPackage,
            contentType: "application/json; charset=UTF-8",
            dataType: "json",            
            error: errorFunction,
            success: successFunction
        });

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ajax