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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:29:29+00:00 2026-06-03T02:29:29+00:00

I have an aspx page and a asp textbox control which has ajax autoCompleteExtender.

  • 0

I have an aspx page and a asp textbox control which has ajax autoCompleteExtender. I want the page to be redirected to another page according to the selected element from the autocomplete list. But when I use

window.location()

nothing is happening, just the same page is refreshed. Here is my javascript;

<script type="text/javascript">
    function selectCity() {
        var str = document.getElementById('<%= txtSearchForDestination.ClientID %>').value;
        var array = str.split(",");
        var city = array[0].replace(/^\s\s*/, '').replace(/\s\s*$/, '');
        city = city.replace(/ /g, "+")
        var country = array[1].replace(/^\s\s*/, '').replace(/\s\s*$/, '');
        country = country.replace(/ /g, "+")
        window.location.href("City.aspx?city=" + city + "-" + country);
    }
</script>

The script is working, I tried it with like

alert(“City.aspx?city=” + city + “-” + country)

there is no problem. But when I want to redirect to that page it is not working. I also tried

window.location(“http://www.google.com&#8221;)

it’s not working as well.

What can be the problem ?

  • 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-06-03T02:29:31+00:00Added an answer on June 3, 2026 at 2:29 am

    Have you tried:

      window.location = 'City.aspx?city=' + city + '-' + country;
    

    ?

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

Sidebar

Related Questions

I have an iFrame which has it's source set to another aspx page. The
I have the following control on my ASPX page: <asp:TextBox ID=txtISBN13 runat=server ClientIDMode=Static />
I have a asp Textbox control in my .aspx page. I have a .cs
I have a aspx page that has a UpdatePanel and a asp timer. the
I have a asp.net repeater control in a aspx page, with runat=server and an
I have the list box control (ASP.NET Control On aspx page, language C# ).
I have a Repeater control in my aspx page: <asp:Repeater ID=repeater runat=server EnableViewState=false> <ItemTemplate>
I have an ASP.NET web page(Not MVC ) (HomePage.aspx) and another page (PRiceList.aspx).I have
I have an ASP.NET page with code-behind in VB.NET. On the ASPX page I
This is what I have in the aspx page: <head runat=server> <title>Website - <asp:ContentPlaceHolder

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.