title: ajax. The resource cannot be found
body: <p>I'm using C# asp.net mvc4 and trying to do ajax search. But ther is error and it says " The resource cannot be found.".
   What I'm doing wrong?</p>
  
  <p>Controller</p>
  
  <pre><code>    //Search
      [HttpPost]
      public ActionResult ContractSearch(string Name)
      {
          var contracts = db.Contracts.Include(c =&gt; c.DocType).Include(c =&gt; c.CreditType).Include(c =&gt;          c.Bank).Include(c =&gt; c.UserProfile).Where(c =&gt; c.FirstName.Equals(Name));
          return View(contracts.ToList());
      }
  </code></pre>
  
  <p>View</p>
  
  <pre><code>@model IEnumerable&lt;CreditoriyaApp.Models.Contract&gt;
  
  @{
  ViewBag.Title = "Index";
  }
  
  &lt;div&gt;
  @using (Ajax.BeginForm("ContractSearch", "Contract", new AjaxOptions { UpdateTargetId = "searchresults" }))
  {
  &lt;input type="text" name="Name" /&gt;
  &lt;input type="submit" value="Search" /&gt;
  }
  
  &lt;div id="searchresults"&gt;
  @if (Model != null &amp;&amp; Model.Count()&gt;0)
  {
      &lt;ul&gt;
      @foreach (var item in Model)
      { 
          &lt;li&gt;@item.FirstName&lt;/li&gt;
      }
      &lt;/ul&gt;
  }
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>Error</p>
  
  <pre><code>Server Error in '/' Application.
  
  The resource cannot be found.
  
  Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed,   had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is  spelled correctly. 
  
  Requested URL: /Contract/ContractSearch
  </code></pre>