I am developing a discussion panel in which I am going to post the comment and want to save it in database through controller and using the following code
$("#btnPostComment").click(function () {
var strdata = $("problemID").val() + $("empID").val() + $("#_1").val() + "0" + "0";
$.ajax({
type: "POST",
URL: <%= Url.Action("PostComment", "Discussion") %>,
data: 'strdata',
dataType: "bool",
success: function (msg) {
alert("Success" + msg);
}
})
})
or I am also trying
var url = "/Controllers/DiscussionController/PostComment";
$.post(url, { comment: "abc" }, function (data) {
alert("d");
})
but not getting the results