title: ajax success function not fired MVC
body: <p>I am trying to get my success result in a div through ajax query.</p>
  
  <p>Ajax query is taking <code>model</code> value as parameter and filtering result according to that.</p>
  
  <p><strong>Here is my ajax query and view page-</strong></p>
  
  <pre><code>@model IEnumerable&lt;FunRanger.Models.TagModel&gt;
  @foreach (var item in Model) {
      &lt;script type="text/javascript"&gt;
          $(function () {
              $('#' + '@item.tagId').click(function () {
                  $.ajax({
                      url: '/Tag/TagFilter/?tagName=' + '@item.tagName',
                      type: 'post',
                      success: function (data) {
                          $('#funhome-partial').html(data);
                      }
                  });
              });
  
          });
      &lt;/script&gt;
      &lt;div class="tags"&gt;
          &lt;a href="#" id="@item.tagId"&gt;#@item.tagName&lt;/a&gt;
      &lt;/div&gt;
  
  }
  </code></pre>
  
  <p>I am trying to filter this result in another div whose id is 'funhome-partial`. This div is in <strong>Another project file</strong> of my project.</p>
  
  <p><strong>Action-</strong></p>
  
  <pre><code>[HttpPost]
  public ActionResult TagFilter(TagModel tag) {
      var cardlist = (from u in db.CardTables
                      where u.CardHashCode.Contains(tag.tagName)
                      select new CardModel {
                          cardHashCode = tag.tagName,
                          cardDate = u.CardDate,
                          cardFileName = u.CardFileName,
                          cardFilePath = u.CardFilePath,
                          cardID = u.CardID,
                          cardTitle = u.CardTitle
                      }).ToList();
      return View("FunHome", cardlist);
  
  }
  </code></pre>
  
  <p>Everything works fine. I get filtered records according to that parameter that i can check by putting breakpoint there.</p>
  
  <p>But This query doesn't call <code>success</code> function of ajax and shows me this error-</p>
  
  <p>In case of a parameter named <code>RipEnglish</code>.</p>
  
  <pre><code>Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://localhost:61203/Tag/TagFilter/?tagName=RipEnglish
  </code></pre>
  
  <p>How do I get ajax success result called, also is this a fine way of doing it?</p>