title: Webpart call to Web Handler
body: <p>I have a webpart which calls ASP.NET handler to accomplish the autocomplete functionality. </p>
  
  <pre><code>ASHX File
      &lt;%@ WebHandler Language="C#" Class="MyService.MyAutoComplete" CodeBehind="MyAutoComplete.ashx.cs" %&gt;
  </code></pre>
  
  <p>Code Behind File</p>
  
  <pre><code>namespace MyService
  {
      /// &lt;summary&gt;
      /// Summary description for MyAutoComplete
      /// &lt;/summary&gt;
      public class MyAutoComplete : IHttpHandler
      {
          public void ProcessRequest(HttpContext context)
          {
              var searchTerm = context.Request.QueryString["term"].ToString();
  
              context.Response.Clear();
              context.Response.ContentType = "application/json";
  
  
              var search = GetList();
  
              JavaScriptSerializer jsSerializer = new JavaScriptSerializer();
              string json = jsSerializer.Serialize(search);
              context.Response.Write(json);
              context.Response.End();
          }
  
      }
  }
  </code></pre>
  
  <p>This is my JQuery call</p>
  
  <pre><code>$(function () {
              $("#&lt;%= txtSearchInput.ClientID %&gt;").autocomplete({
                  source: "/_Layouts/My Service/MyAutoComplete.ashx",
                  minLength: 2,
                  select: function (event, ui) {
                      $(this).val(ui.item.value);
                  }
              });
          });
  </code></pre>
  
  <p>The "My Service" is SharePoint layout folder inside the webpart project.</p>
  
  <p>When I make call thro JQuery it throws the following error
  "Could not create type 'MyService.MyAutoComplete'"</p>
  
  <p>Any help appreciated. </p>