title: Jquery Autocomplete from an Array in Session
body: <p>I will be storing an array in session that will contain data entered by the user (id numbers used to search in several different areas of the application)</p>
  
  <p>I then want to return the values in this array that is residing in session as auto complete selections.  </p>
  
  <p>Getting the array into session and updating it is the easy part, getting it from session into the autocomplete isn't as much so.  </p>
  
  <p>I'd rather use the array to do the auto complete instead of converting to json.</p>
  
  <p>I've tried using <code>'&lt;%= SESSION("MEMBER_SEARCH_ARRAY") %&gt;'</code> as the source for the autocomplete but no dice.</p>
  
  <p>Is it possible to do something like:</p>
  
  <pre><code>$.ajax({
       url: "../ajax/MemberAuto.ashx",
       dataType: "text",
       success: function(data) { 
            $('#txtDealerNumber').autoComplete({ source: data }); // &lt;- Object doesn't support this property or method error
       },
            error: function(xhr, status, error) { }
  });
  </code></pre>
  
  <p>when MemberAuto.ashx contains:</p>
  
  <pre><code>Public Class MemberAuto : Implements IHttpHandler, IRequiresSessionState, IReadOnlySessionState
  
      Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
          context.Response.ContentType = "text/plain"
          context.Response.Write(Join(context.Session("MEMBER_SEARCH_ARRAY"), ","))
          context.Response.End()
      End Sub
  
      Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
          Get
              Return False
          End Get
      End Property
  End Class
  </code></pre>
  
  <p>unfortunately I get an error following the ajax call in the success.</p>
  
  <p>Any input would be greatly appreciated</p>