Hey guys I´m having some issues by getting a value to the controller in MVC.
This is my HttpPost at the controller:
[HttpPost]
public void GlobalIsWeekCheck(bool? incomingIsWeek)
{
GlobalIsWeek = incomingIsWeek;
}
And this is my script on the view:
var incomingIsWeek = false;
$.ajax({
type: "POST",
url: "/Home/GlobalIsWeekCheck",
data: incomingIsWeek,
success: function() {
alert('Successfully connected to the server');
},
error: function() {
alert('Something went wrong');
}
});
Anyone knows why am I getting a null variable on my controller everytime I call this ajax?