Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4082650
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:12:50+00:00 2026-05-20T18:12:50+00:00

I will be storing an array in session that will contain data entered by

  • 0

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)

I then want to return the values in this array that is residing in session as auto complete selections.

Getting the array into session and updating it is the easy part, getting it from session into the autocomplete isn’t as much so.

I’d rather use the array to do the auto complete instead of converting to json.

I’ve tried using '<%= SESSION("MEMBER_SEARCH_ARRAY") %>' as the source for the autocomplete but no dice.

Is it possible to do something like:

$.ajax({
     url: "../ajax/MemberAuto.ashx",
     dataType: "text",
     success: function(data) { 
          $('#txtDealerNumber').autoComplete({ source: data }); // <- Object doesn't support this property or method error
     },
          error: function(xhr, status, error) { }
});

when MemberAuto.ashx contains:

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

unfortunately I get an error following the ajax call in the success.

Any input would be greatly appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T18:12:51+00:00Added an answer on May 20, 2026 at 6:12 pm

    Assuming that you are using jQueryUI(seems like autocomplete is not a part of jQuery core), This can be easily implemented in this way. No need of ajax as autocomplete automatically does this.

     $(document).ready(function () {
            $("#txtDealerNumber").autocomplete({
                source: '../ajax/MemberAuto.ashx?AutoComplete'
            }); //function name is autocomplete not autoComplete
     });
    

    where the url ../ajax/MemberAuto.ashx?AutoComplete
    returns(test it in the browser) in the format

    ["option 1", "option 2", "option 3"]
    

    see here for more details.
    http://jqueryui.com/demos/autocomplete/#option-source

    Edit1: If you really want to stick in your way. then you need to convert your string to array which can be done using eval().

    ie.

    $.ajax({
         url: "../ajax/MemberAuto.ashx",
         dataType: "text",
         success: function(data) { 
              $('#txtDealerNumber').autocomplete({ source: eval(data) }); 
              // data should be in the format ["option1", "option2"]
         },
              error: function(xhr, status, error) { }
    });
    

    for testing eval http://jsfiddle.net/wZkjZ/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I go about storing a vb.net user defined object in a sql
I am working on a basic Struts based application that is experience major spikes
On the subject of dynamically storing temporary images and handling their cleanup on a
There are several ActiveRecord styled query builder libraries out there. Some are stand alone
I think the title says it, as well...but of course some more explanation assume
I am new in web services so apologize me if I am making some
I'm pretty new to SharePoint Web Part development, so I'm not sure the best
I've been working on a simple forum for my site. I'm adding a feature
I have an object, say a note, whose parameters I want to save in
We have a web-based application, backed by a MySQL database. One part of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.