I am making an ajax call to a method in my controller. The method returns a Partial View ActionResult back to the success method in the ajax call. I want to pass an additional message or variable to that success message so I can check for something. Here is my current javascript ajax call:
$.ajax({
url: '@Url.Action("_AddToCart", "Cart")',
data: {
id: id,
qty: quantity
},
success: function (response) {
var cartLink = $(".add").attr("data-url");
$("#summary").html(response);
I am setting the HTML of a div to the entire response. How can I pass an additional message or variable from the controller back to the success function?