For OnChange event of a dropdown, I am making a ajax call. In the url path, when I give the Controller/Action path it does not hit the method at all.
My code looks like:
function FillHO() {
var stateId = $('#ddlHO').val();
$.ajax({
type: "POST",
url: '@Url.Action("SetSelectedHO","../../Controllers/ReportsController")'
contentType: "application/json; charset=utf-8",
dataType: "json",
data: '{SelectedValue: "' + stateId + '" }',
success: function (response) {
alert('Test');
},
failure: function (response) {
alert(response.d);
}
});
}
What I have tried:
I have tried '../../Controllers/ReportsController/SetSelectedHO'
'ReportsController/SetSelectedHO'