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 3847040
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T16:29:25+00:00 2026-05-19T16:29:25+00:00

I have an ASP.NET MVC 3 Web Application (Razor), and a particular View with

  • 0

I have an ASP.NET MVC 3 Web Application (Razor), and a particular View with the jQuery UI AutoComplete plugin (v1.8).

Here’s the setup i currently have:

$('#query').autocomplete({
        source: function (request, response) {
            $.ajax({
                url: "/Search/FindLocations",
                type: "POST",
                dataType: "json",
                data: { searchText: request.term },
                success: function (data) {
                    response($.map(data, function (item) {
                        return { name: item.id, value: item.name, type: item.type }
                    }))
                },
                error: function (xmlHttpRequest, textStatus, errorThrown) {
                    // don't know what i should do here...
                }
            })
        },
        select: function (event, ui) {
            $.get('/Search/RenderLocation', { id: ui.item.name }, function (data) {
                $('#location-info').html(data);
            });
        },
        delay: 300, minLength: 3
    });

The AutoComplete returns locations in the world, basically identical to Google Maps auto complete.

Here are my questions:

1) What are the recommended settings for delay and minLength? Leave as default?

2) I thought about putting [OutputCache] on the Controller action, but i looks as though the plugin automatically does caching? How does this work? Does it store the results in a cookie? If so when does it expire? Is any additional caching recommended?

3) I’ve noticed if i type something, and whilst the AJAX request is fired off, if i type something else, the dialog shows the first result momentarily, then the second result. I can understand why, but it’s confusing to the user (given the AJAX request can take 1-2 seconds) but i’m thinking about using async: false in the $.ajax options to prevent multiple requests – is this bad design/UX?

4) Can you recommend any other changes on my above settings for improving performance/usability?

  • 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-19T16:29:25+00:00Added an answer on May 19, 2026 at 4:29 pm

    1) It really depends on your usage and your data.

    2) You should use [OutputCache]. If there’s any caching happening on the plugin, it’s only going to be for each user, if you use caching at the controller action level, it’ll cache one for all users. (again, this might actually be bad depending on your usage, but usually this is good to do)

    3) This questions kind of hard too because of the lack of context. If ajax requests are 1-2 seconds and there’s no way to make this shorter, you really should be a pretty big delay in so that users aren’t sending off many requests while typing out a long word (if they type slow).

    4) sounds like you need to look at your /search/FindLocations method and see where you can do caching or pref improvements. Give us a look at your code in here and I can try to suggest more.

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

Sidebar

Related Questions

I have an ASP.NET MVC 3 (Razor) Web Application, with a particular page which
With ASP.NET MVC, it is common to have AJAX code(e.g. jQuery) to invoke web
I have an ASP.NET MVC Web Application that interacts with a SQL Server 2008
I have an ASP.NET MVC web application which is hosted by an external provider,
I have built an ASP.NET MVC web application that uses Entity Framework. To provide
If i have an ASP.NET MVC 2 Web Application with the following Views: Main.aspx
I have an ASP.NET MVC 3 / .NET Web Application, which is heavily data-driven,
I have a Silverlight project (with ASP.net MVC web project) Suddenly, when I press
Background I have a page on my ASP.NET MVC web app for users to
I have a standard ASP.NET MVC (RC Refresh) web project, with the standard ASP.NET

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.