title: Ajax call with a 'failed to load resource : the server responded with a status of 500'
body: <p>I created a function that do an ajax call but I have this error when I call my GetTempData method in C# :</p>
  
  <pre><code>Failed to load resource: the server responded with a status of 500 (Internal Server Error) 
  </code></pre>
  
  <p>This is my code : </p>
  
  <pre><code>function restoreDatas() {
          $.ajax({
              url: "/AddRecipe/GetTempData",
              type: 'GET',
              dataType: 'json',
              contentType: 'application/json',
              cache: false,
              processData: false,
              success: function (result) {
  
              }
          });
      }
  </code></pre>
  
  <p>The C# method called by the ajax call : </p>
  
  <pre><code>public ActionResult GetTempData()
      {
          return Json(
          new
          {
              title = Session["title"],
              cookingTime = Session["cookingTime"],
              preparationTime = Session["preparationTime"],
              IngredientList = Session["IngredientList"],
              ingredientsDescription = Session["ingredientsDescription"],
              nbPersons = Session["nbPersons"],
              Category = Session["Category"],
              difficulty = Session["difficulty"],
              nbStars = Session["nbStars"],
              file = Session["file"]
          }, JsonRequestBehavior.AllowGet
              );
      }
  </code></pre>
  
  <p>I don't see where is the problem ? </p>
  
  <p>Do you have any solutions ?</p>
  
  <p>Thank you</p>