Hi! im working on getting user input and passing it to the save controller to save it to the database but it doesnt seem to work. I did some searching and tried to use jquery.ajax and jquery.post but it still wont work. Heres my code:
and I tried this one as well:HTML Code:$.post("/PostCategories/Save", getDate(), function (data) { alert("Saved successfully!"); });
I put a breakpoint in my save controller but it doesnt even reach the controller. Need help!HTML Code:$.ajax({ type: "POST", url: "@Url.Action("PostCategories", "Save");", dataType: "json", data: getData(), processData: true, success: function (data) { alert("Saved successfully!"); alert(data); }, error: function (xhr, ajaxOptions, error) { alert(xhr.status); alert("Error: " + xhr.responseText); } }); // end of ajax


Reply With Quote

By the way its working already. I've made some mistake with the url. the only problem im having now is the dialog not closing after saving the data to the database. 