title: JQuery.ajax/asp.net: if the called page returns the parameters it works but if it performs a linq query then it fails
body: <p>So I'm really lost on this one and would be much appreciative of some help. </p>
  
  <p>Here's what I'm trying to do: the user submits a form. the second javascript bit below sends form data to a page which submits the information to the database without refreshing the page. This works fine and then calls UpdateResponseText(). UpdateResponseText calls a page which retreives the information (the c# code below) and writes out some string. This value should appear in an alert() box.</p>
  
  <p>Here's the problem: The page Article/GetResponse works fine. I can type in the url manually and get the expected result. However, the "success" portion of UpdateResponseText() never fires so the javascript, I'd believe, has a problem. What's odd though is if I DON'T use the SQL and just Response.Write the parameters then it works.</p>
  
  <p>Here's the Javscript:</p>
  
  <pre><code>            function UpdateResponseText() {
                  alert("Function Called");
                  $.ajax({
                      type: "GET",
                      dataType: "json",
                      url: "@string.Format("{0}://{1}{2}", Request.Url.Scheme, Request.Url.Authority, Url.Content("~"))/Article/GetResponse",
                  data: "UserID=@Model.UserInfo.ID&amp;ArticleID=@Model.Content.KEY",
                      success: function (json) {
                          alert("Success");
                      alert(json);
                  }
              })
          }
              $('#ArticleFeedbackForm').submit(function () {
                  var formdata = $(this).serialize();
                  alert(formdata);
                  $.ajax({
                      type: "POST",
                      url: "#",
                      data: formdata,
                      success: function () {
                          UpdateResponseText();
                      }
                  });
                  return false;
              });
  </code></pre>
  
  <p>The C#:</p>
  
  <pre><code>    public void GetResponse(string UserID, string ArticleID)
      {
  
          HelpSiteEntities1 db = new HelpSiteEntities1();
          var ARID = Convert.ToInt32(ArticleID);
          FeedbackObject TheFeedbackObject = new FeedbackObject();
          var QuestionQuery = (from Q in db.Questions
                               join U in db.QuestionMaps
                               on Q.ID equals U.QuestionID
                               where U.TopicID == ARID
                               select new { TheQuestionText = Q.Question1, TheQuestionID = Q.ID }).ToList();
          var QuestionID = (QuestionQuery.Select(o =&gt; o.TheQuestionID).ToList()[0]);
          //Response.Write(UserID + ARID.ToString() + QuestionID);
          var AnswerOptionsQuery = from A in db.QuestionAnswers
                                   where (A.MapsToID == QuestionID)
                                   select new { TheAnswerText = A.AnswerText, TheAnswerIDs = A.ID, IsStatic = A.StaticResp };
          var AnswerOptions = AnswerOptionsQuery.ToList();
          var previousResponse = (from x in db.QuestionRespMaps
                                  where x.UserID == UserID &amp;&amp; x.QuestionID == 1 &amp;&amp; x.TopicID == ARID
                                  select x).FirstOrDefault();
          if (previousResponse != null)
          {
  
              Response.Write("You have indicated previously \"" + (AnswerOptionsQuery.Where(o =&gt; o.TheAnswerIDs == previousResponse.AnswerID).ToList())[0].TheAnswerText + "\". You may update your response below at any time.");
          }
          else
          {
             Response.Write("");
          }
  
      }
  </code></pre>