I'm getting a 500 error, whenever I try to grab data from my controller using ajax. It seems that the controller is not reading the Guid at all, even though the id has been passed correctly to the ajax function
Here is my function call in Ajax:
const handleDetails = (id) => {
$.ajax({
type: 'GET',
url: '/Monsters/Details',
data: id,
success: function (result) {
alert('Successfully received Data ');
console.log(result);
},
error: function () {
alert('Failed to receive the Data');
console.log('Failed ');
}
})
}
Here is my controller:
public async Task<IActionResult> Details(Guid id)
{
return View(await _monstersData.GetMonsters(id));
}