Ok so driving me nuts with this one. Works fine locally but when posted to the web server it pukes saying 500 (internal server error). Formatted and called the same as other procedures which are working and always have. Seems the content is changing in the call from json to text but not sure if thats causing it not to be found.
Variables are populated with correct data / type checked with console.log in the ajax call.
Code:function templateCreate(e) { var ddl = 123; var id = 2319; $.ajax({ cache: false, async: true, type: "POST", contentType: "application/json;charset=utf-8", url: "/Document/GenerateDocument/", data: { fileNumber: "@Model.FileNumber", templateID: id }, success: function (data) { Message(data.ResultSuccess, data.ResultMessage); }, error: function (data) { Message(false, "Error"); } }); }Code:[HttpPost] public JsonResult GenerateDocument(string fileNumber, long templateID) { //STUFF return Json(new { ResultSuccess = model.ResultSuccess, ResultMessage = model.ResultMessage, UpdatedDate = updatedDate }, JsonRequestBehavior.AllowGet); }





Reply With Quote