The following is what I am using in my code and it displays the ugly looking alert: $.ajax({ type: 'POST', url: "Default.aspx/SetSession", data: '{ "name" : "' + name + '" }', cache: false, async: false, contentType: 'application/json; charset=utf-8', dataType: 'json', success: function (result) { alert("File uploaded successfully..."); }, error: function (result) { alert("Failed to upload file..."); } });