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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:12:12+00:00 2026-05-16T15:12:12+00:00

Everything works perfectly fine in debug but silently blows up on the live server.

  • 0

Everything works perfectly fine in debug but silently blows up on the live server.

Here’s my jquery which checks to see what is selected in a dropdown box on the page:

<script type="text/javascript" >
    $(document).ready(function () {
        $("#Schools").change(function () {
            if ($("#Schools").val() != "") {
                $.post("ReturnVisitDates", { SchoolID: $("#Schools").val() }, function (retHTML) {
                    document.getElementById("VisitDates").innerHTML = retHTML;
                });
            }
            else {
                document.getElementById("VisitDates").innerHTML = "";
            }
        });
    });

Here is the action result that is posted to from the jquery:

Function ReturnVisitDates(ByVal SchoolID As Integer) As ActionResult
    Dim articlerepo As New NewsRepository
    Dim _VisitDates As New List(Of SelectListItem)
    _VisitDates = articlerepo.ListAllVisitDates(SchoolID)
    For Each item In _VisitDates
        item.Text = FormatDateTime(item.Text, DateFormat.ShortDate)
    Next
    If _VisitDates.Count > 0 Then
        ViewData("VisitDates") = _VisitDates
        Return PartialView("ReturnVisitDates")
    End If
End Function

Here’s the main view:

<div style="text-align:center">
<h1>Welcome to EV Connect!</h1><br />
<h2>Please select your school:</h2>
<% Using Html.BeginForm()%>
<div style="text-align:center"><%: Html.DropDownList("Schools")%></div><br />
<div id="VisitDates"></div>
<br />
<% End Using%>

and the partial view:

<%: Html.DropDownList("VisitDates")%><br /><br />

As stated before this works perfectly fine in my dev environment and seems to fail on the live server. I’ve done some digging around with firebug and it seems to be throwing a 404 on the partialview saying that it can’t find “Home/ReturnVisitDates”.

  • 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-16T15:12:12+00:00Added an answer on May 16, 2026 at 3:12 pm

    I would recommend you to always use HTML helpers when dealing with urls instead of hardcoding them as you did. This way no matter how your routes look like or where your site is deployed (virtual directory or not) it will simply work:

    $(function () {
        $('#Schools').change(function () {
            var schoolId = $(this).val();
            if (schoolId != '') {
                var url = '<%= Url.Action("ReturnVisitDates", "Home") %>';
                $('#VisitDates').load(url, { SchoolID: schoolId });
            } else {
                $('#VisitDates').html('');
            }
        });
    });
    

    Also why are you using jQuery and still performing DOM manipulation manually using document.getElementById? And notice how the .load() function could simplify your code.

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

Sidebar

Related Questions

I have a program which writes its output using ofstream. Everything works perfectly fine
I have my pickerview set up and everything works fine, but right now I
I'm writing an rmi application. Everything works perfectly fine when i put the all
I've been working on custom Vector class. Everything works perfectly fine on Microsoft compiler,
I have a drop down menu and it works perfectly on everything except IE6
Everything works fine when the unit tests class is part of the main project
Everything works as supposed to on the Django development server. In Apache, the django
using jquery ui 1.8 trying autocomplete Everything works apart from that the ui-menu isn't
I'm building a project using a GNU tool chain and everything works fine until
I am using hibernate annotations and when I do following everything works fine sessionFactory

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.