I have an action method which returns a partial view to an ajax call. Whenever the partial view is received in success block of the ajax call, I am rendering it like this;
success: function (res) {
$('#competitorTables').html(res);
}
But the action method has a condition within itself and it can result either true or false. I want to be able to return this boolean value with my return PartialView()
block and then I want to be able to process it in my ajax call like this;
success: function (res, isConditionSatisfied) {
if(isConditionSatisfied){
$('#competitorTables').html(res);
alert('Condition satisfied');
}else{
$('#competitorTables').html(res);
alert('Condition did not satisfied');
}
}
Is there a way that I can manage it? Thanks in advance.
Addition: Here is how I return from my action method;
return PartialView("_CompetitorTables", model);