I created a function that do an ajax call but I have this error when I call my GetTempData method in C# :
Failed to load resource: the server responded with
Bring up the developer tools in your browser and take a look at the request / response. For example, in Chrome press F12 to bring up the developer console and head to the Network tab. Try calling your GetTempData method again. You will see an entry in the network tab that corresponds to the GetTempData request and is highlighted in red. If you click on that you will be able to see detailed information about your request and response.
HTH