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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:14:55+00:00 2026-06-04T04:14:55+00:00

I have a dynamic MVC4, jQuery Mobile application that works for the most part

  • 0

I have a dynamic MVC4, jQuery Mobile application that works for the most part quite well. I have an auto posting dropdown list that selects a list from the database via the following code.

<script type="text/javascript">
    $(function () {
        $("#TownID").live('change', function () {
        //$("#TownID").change(function () {
            var actionUrl = $('#TheForm1').attr('action') + '/' + $('#TownID').val();
            $('#TheForm1').attr('action', actionUrl);
            $('#TheForm1').submit();
        });
    });
</script>

<p>
     @using (Html.BeginForm("SearchTown", "Home", FormMethod.Post, new { id = "TheForm1" }))
    {
        @Html.DropDownList("TownID", (SelectList)ViewBag.TownId, "Select a Town")
    }
</p>

The problem is it only works properly the first time a search is performed unless I click refresh. I don’t think this has anything to do with MVC, I think the problem is with AJAX and jQuery Mobile.

Edit:

The first time I search http://www.mysite.com/Home/Search/2 yields a result and woks fine, but the second time something seems to be left behind in the DOM??? and it looks for:

www.mysite.com/Home/Search/2/2 also

I get 404 errors in my log and “Error Loading Page” but it still finds the results and displays the page correctly!

Then with a third search I get the error 404’s in my log and “Error Loading Page” but it has grown and now looks for:

www.mysite.com/Home/Search/2/2
www.mysite.com/Home/Search/2/2/2 also

This then continues to grow after every search until at some seemingly random point on each test, it seems to give up and I get error 505

Additional Edit:

The code works perfectly if I take jQuery Mobile out of the question

Can anyone tell me what might be going on here?

  • 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-04T04:14:55+00:00Added an answer on June 4, 2026 at 4:14 am

    I guess this is one for the future, MVC and jQuery Mobile don’t seem to blend completely right now. Maybe MS’s response to the issue is Single Page Applications!

    SPA may satisfy Danial also?

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

Sidebar

Related Questions

Description: I have a simple form in an MVC4 application that has 5 textboxes
I have some divs that have dynamic heights controlled by a 'click' function as
I have some divs that have dynamic heights controlled by a 'click' function as
I have a dynamic value that is being stored in a PHP variable. The
I have an dynamic array and I want to exclude the first part of
I have dynamic grid-based tables in the application I am developing. The following code
I have set up my coldfusion application to have dynamic urls on the page,
I'm building an application which will have dynamic allocated objects of type A each
I have dynamic json result and i want to create an object for that
I have dynamic array in struct and a method that uses the dynamic array.

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.