I'm trying to pass multiple objects to my jquery post data object like this:
return View("AffiliateManager", /*and now pass the JSON flag here*/);
The "JSON Flag" would be just this:
Json("Ok"); => signaling that call was success
So that I can fetch both HTML of the page and the "OK" parameter in my jquery post data object like this:
.done(function (data) {
if (data == "ErrorRequest") {
ShowErrorMessage("You don't have enough money to request payment!");
$('.btnRequestPayout').prop('disabled', false);
return;
}
else if(data=="Ok"){
ShowMessage("Payment request successfully made.");
$('.btnRequestPayout').prop('disabled', false);
var wholePage = $('<div />').append(data).find('#divPage').html();
$('#divPage').html(wholePage);
}
});
So now that I have in data object like this:
data.html => whole HTML of the page
data.flag => signal whether the call was good
How can I achieve this in .NET MVC ?