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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:41:16+00:00 2026-06-08T04:41:16+00:00

My application is located on the server under a separate virtual directory. To access

  • 0

My application is located on the server under a separate virtual directory. To access my ASP.NET MVC application users have to go to:

http://server-dev/superApp

I have a problem with Ajax/Json server requests ignoring the “superApp” directory part. Whenever an Ajax request is made Fiddler shows 404 because instead of http://server-dev/superApp/User/GetUsersJson for example, http://server-dev/User/GetUsersJson is called (note the missing superApp name).

Example of an Ajax request:

function GetUsers(id) {
    $.ajax({
        url: "/User/GetUsersJson/",
        data:{ id: id},
        datatype: 'json',
        type:'post',
        success: function (result) {
            ////Do stuff with returned result
        }        
    });      
}

Registered route:

r.Match("User/GetUsersJson", "User", "GetUsersJson");

Where should I look and what can I change to make sure that my application virtual folder is ALWAYS included in all URL requests ?

p.s. Please note that all Javascript/Ajax logic is kept in separate .js files so no RAZOR syntax is available.

  • 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-08T04:41:18+00:00Added an answer on June 8, 2026 at 4:41 am

    Did you try using the HTML helper method ?

    url: "@Url.ACtion("GetUsersJson","User)"
    

    EDIT : As per the comment

    You may get the Path name using the HTML Helper method and Keep that in a Global variable and access that in the external javascript file

    In the view

    <script type="text/javascript>
      var globalGetJSONPath='@Url.ACtion("GetUsersJson","User)';
    </script>
    

    And now you can use it in the external file like this

     $.ajax({
            url: globalGetJSONPath,
            data:{ id: id},
            //remaining items....
    
      });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have web application (asp.net) located on web server. I need to send email
I am running an ASP.NET application. The web server is located on the same
We are deploying our ASP.Net MVC application to a windows 2008 R2 server, running
I have an ASP.NET MVC application, when a user clicks on the submit button
I have IIS installed on a server configured with asp.net 2.0 and a directory
My ASP.NET MVC 2 application runs under built-in local NETWORK SERVICE account. I want
We have a couple of WCF services hosted in an asp.net application on IIS.
I deployed my asp.net mvc2 .net4 web application at a win2k8 32bit server with
I have TCP client application and trying to connect with Server located at remote
I have an asp.net 2.0 web application that will run on the same web

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.