title: jquery.autocomplete - Illegal characters in path
body: <p>I am using the jquery.autocomplete plugin and when it makes the Ajax request it is giving me HTTP error code 500, and the body of the message says illegal character in path.</p>
  
  <p>I am using MVC3 and I have moved the javascript code from the view to a seperate script file which is refereneced in my _layout.cshtml file. Before I moved my javascript it was working but now it doesn't and I don't understand why.</p>
  
  <p><strong>Autocomplete.js</strong></p>
  
  <pre><code>$(document).ready(function () {
      alert("one");
      $("#group_name").autocomplete('@Url.Action("LookUpGroupName", "UserManager")', // Call LookUpGroupName ActionResult in UserManager Controller
          {
          dataType: 'jsonp',
          parse: function (data) {
              var rows = new Array();
              for (var i = 0; i &lt; data.length; i++) {
                  rows[i] = {
                      data: data[i],
                      value: data[i].group,
                      result: data[i].group
                  }
              }
              return rows;
          },
          formatItem: function (row, i, max) {
              return row.group;
          },
          width: 300,
          highlight: false,
          multiple: false
      }); // End of autocomplete
      alert("two");
  });
  </code></pre>
  
  <p><strong>_Layout.cshtml</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;@ViewBag.Title&lt;/title&gt;
      &lt;link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" /&gt;
      &lt;link href="@Url.Content("~/Content/themes/base/jquery.ui.autocomplete.custom.css")" rel="stylesheet" type="text/css" /&gt;
      &lt;script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="@Url.Content("~/Scripts/jquery.autocomplete.js")" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="@Url.Content("~/Scripts/Custom/autocomplete.js")" type="text/javascript"&gt;&lt;/script&gt;
    &lt;link href="@Url.Content("~/Content/themes/base/jquery.ui.autocomplete.css")" rel="stylesheet" type="text/css" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div class="page"&gt;
          &lt;header&gt;
             &lt;div id="title" &gt;
      &lt;h1 style="color:Black"&gt;ALF and BRAD User Manager&lt;/h1&gt;
  &lt;/div&gt;
  &lt;div id="logindisplay"&gt;
      &lt;span style="color:Black; background-color:white; border-color:Black; border-style:solid; border-width:thin; text-align:right;"&gt;
          Logged in as:&amp;nbsp&lt;strong&gt;@Context.User.Identity.Name&lt;/strong&gt;
      &lt;/span&gt; 
  &lt;/div&gt;
  
              &lt;nav&gt;
                  &lt;ul id="menu"&gt;
                      @Html.ActionLink("Home", "Index", "Home")&amp;nbsp&amp;nbsp
                      @Html.ActionLink("User Management", "Index", "UserManager")&amp;nbsp&amp;nbsp
                      @Html.ActionLink("User Status", "Index", "UserStatus")&amp;nbsp&amp;nbsp
                      @Html.ActionLink("Email Distibution List", "Index", "EmailDistributionList")&amp;nbsp&amp;nbsp
                      @Html.ActionLink("Email User Details", "Index", "EmailUserDetails")&amp;nbsp&amp;nbsp
                  &lt;/ul&gt;
              &lt;/nav&gt;
          &lt;/header&gt;
          &lt;section id="main"&gt;
              @RenderBody()
          &lt;/section&gt;
          &lt;footer&gt;
          &lt;/footer&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>&lt;!-- Declare model to be used for view --&gt;
  @model UserManager.Models.vw_UserManager_Model_Add_Users 
  @{
      ViewBag.Title = "Create New User";
  }
  &lt;h2&gt;
      CreateUser&lt;/h2&gt;
  @using (Html.BeginForm())
  {
      @Html.ValidationSummary(true)
      &lt;fieldset&gt;
          &lt;legend&gt;New User Details&lt;/legend&gt;
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(Model =&gt; Model.salutation)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; Model.salutation)
              @Html.ValidationMessageFor(model =&gt; Model.salutation)
          &lt;/div&gt;
         @{Html.Partial("~/Views/Partial/_AutocompleteGroupName.cshtml", this.ViewData);
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/vOWlw.png" alt="Ajax Response"></p>