I have passed a token from a View to a function in my HomeController, and now want to perform an action on the token and return the information to the frontend. I thought that the resultData from the ajax call would be the output of GetMyData, however it is just the token that I passed in in the first place. Any help would be great, thanks.
JS
$.ajax({
url: '/Home/GetMyData',
type: 'POST',
dataType: 'json',
data: {token: token},
success: function(resultData){
console.log(resultData);
}
})
Home Controller
public JsonResult GetMyData(string token)
{
...
return Json('ok')
}
