Hi i am invoking a Ajax call to my controller method from a view on button click. Ajax method fails by giving the error "Object not Found". This happens when it is deployed on Windows XP. It does not happen on Windows 7. I am stuck up on this issue from Two days with no help. Any help would be much appreciated. Here is my code.
DisplayAttributes.cshtml
function DisplayFullImage() { var model = { ChoosenColor: sendDesignerData, TotalDensity: TotalPixelFilled }; var urls = '@Url.Action("GetColors","Designer")'; $.ajax({ type: 'POST', url: urls, data: JSON.stringify(model), success: function (data) { }, dataType: "json", contentType: "application/json; charset=utf-8", error: function (Response, Status, Error) { alert("Response: " + Response + " Status: " + Status + " Error: "+Error); } }) } function Generate() { //Some code to fill sendDesignerData and TotalPixelFilled DisplayFullImage(); }DesignerController.cspublic class DesignerController : Controller { // // GET: /Designer/ public ActionResult DisplayAttributes() { return View(); } [HttpPost] public void GetColors(DesignColors DsgColor) { if (DsgColor.ChoosenColor != null && DsgColor.TotalDensity > 0) { Session["Colors"] = DsgColor; } else { List<Colors> DummyColors = new List<Colors>(); DsgColor.ChoosenColor = DummyColors; DsgColor.TotalDensity = 0; Session["Colors"] = DsgColor; } } }
On button click Generate() method is called and i fill an Json object "sendDesignerData" with some values and also assign numeric value to "TotalPixelFilled" variable and then call DisplayFullImage()
The application work when deployed on Windows 7 and does not work on Windows XP. The Ajax call fails and i get error "Object Not Found" in alert.
Thanks in Advance