IE tries to download json response while submitting jQuery multipart form data containing file

You can simply return JSON from the controller as “text/html” and then parse it on the client side using JQuery.parseJSON().

Controller:

    return this.Json(
            new
                {
                    prop1 = 5,
                    prop2 = 10
                }, 
            "text/html");

Client side:

jsonResponse = $.parseJSON(response);

if(jsonResponse.prop1==5) {
     ...
}

This solution has been working for me.

Leave a Comment