title: Microsoft JScript runtime error: '$' is undefined - ASP.NET MVC 4
body: <p>I'm trying to return a partialview after I deleted an element but it is happening the following error:</p>
  
  <p>My partialview opens in a jquery modal</p>
  
  <p>Microsoft JScript runtime error: '$' is undefined</p>
  
  <p>My Action:</p>
  
  <pre><code>      public ActionResult ExcluirContato(int idContato, int idClienteFornecedor)
      {
          string param = idContato + ";" + idClienteFornecedor;
          int id = idClienteFornecedor;
  
          HttpClient client = new HttpClient();
          client.BaseAddress = new Uri(ConfigurationManager.AppSettings["UrlAPI"]);
  
          client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
  
          var url = "api/clienteFornecedor/DeleteContato/" + param;
  
          HttpResponseMessage response = client.DeleteAsync(url).Result;
  
          if (!response.IsSuccessStatusCode)
          {
              ModelState.AddModelError("Erro", "Ocorreu um erro ao excluir o Contato.");
          }
  
          url = "api/clienteFornecedor/GetClienteFornecedor/" + id;
          HttpResponseMessage resposta = client.GetAsync(url).Result;
  
          var clienteFornecedor = resposta.Content.ReadAsAsync&lt;ClienteFornecedor&gt;().Result;
  
          if (clienteFornecedor == null)
          {
              ModelState.AddModelError("ClienteFornecedor", "Ocorreu um erro ao buscar o Cliente ou Fornecedor.");
  
          }
  
          // busco os contatos do clientefornecedor
          url = "api/clienteFornecedor/GetClienteFornecedorByContato/" + id.ToString();
          resposta = client.GetAsync(url).Result;
  
          if (!resposta.IsSuccessStatusCode)
          {
              ModelState.AddModelError("Erro", "Ocorreu um erro ao buscar o Contato.");
          }
          else
          {
              var contatos = resposta.Content.ReadAsAsync&lt;IEnumerable&lt;Contato&gt;&gt;().Result;
              Session["Contatos"] = contatos;
          }
  
          CarregarCombos();
          return PartialView("_CadastroClienteFornecedor", clienteFornecedor);
      }
  </code></pre>
  
  <p>_Layout.cshtml:</p>
  
  <pre><code>   &lt;head&gt;
  &lt;meta charset="utf-8" /&gt;
  &lt;title&gt;@ViewBag.Title&lt;/title&gt;
  &lt;link href="~/Images/favicon.ico" rel="shortcut icon" type="image/x-icon" /&gt;
  &lt;meta name="viewport" content="width=device-width" /&gt;
  &lt;meta http-equiv="PRAGMA" content="NO-CACHE"&gt;
  @Styles.Render("~/Content/css")
  @Scripts.Render("~/bundles/modernizr")
  @Styles.Render("~/Content/themes/base/jquery-ui-1.10.3.custom.css")
  @Styles.Render("~/Content/themes/base/jquery-ui-1.10.3.custom.min.css")
  @Scripts.Render("~/bundles/jquery")
  @Scripts.Render("~/bundles/jqueryui")
  @Scripts.Render("~/bundles/jqueryval")
  </code></pre>