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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:13:04+00:00 2026-05-26T04:13:04+00:00

I am hosting a MVC3 application in IIS7. The aplication got hosted but ajax

  • 0

I am hosting a MVC3 application in IIS7. The aplication got hosted but ajax post is not working in the application.

Could Anyone help on this?

Thanks in advance.

  • 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-26T04:13:04+00:00Added an answer on May 26, 2026 at 4:13 am

    You have hardcoded the urls in your javascript, haven’t you?

    For example you wrote:

    $.ajax({
        url: '/Home/Ajax',
        success: function() {
    
        }
    });
    

    instead of using url helpers:

    $.ajax({
        url: '@Url.Action("Ajax", "Home")',
        success: function() {
    
        }
    });
    

    Also you probably have hardcoded script locations:

    <script type="text/javascript" src="/Scripts/somscript.js"></script>
    

    instead of using url helpers:

    <script type="text/javascript" src="@Url.Content("~/Scripts/somscript.js")"></script>
    

    Now go ahead through your code and replace all urls that you have hardcoded with ones generated with helpers.

    The reason your code doesn’t work when you host it in IIS is because you host your application in a virtual directory. So the correct path is no longer /Home/Index but /SomeAppName/Home/Index. The best way top ensure that your application will work in all environments no matter where it is hosted is to always use url helpers.

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

Sidebar

Related Questions

Hi My hosting Provider has support for MVC3 but not for MVC4. When I
I'm trying to get a MVC3 application working under mono, and everything was going
I'm working on a stock-standard, ASP.NET MVC 3 web application (hosted on IIS 7).
I have published an ASPNET MVC3 application to a service hosting. I use standard
I am hosting a WCF service in an MVC3 web application. I have a
I have an ASP.Net MVC 3 Website hosted on a shared Windows hosting package.
I'm planning on hosting a Silverlight application in ASP.NET 2.o web application. The web
My hosting provider does not have curl extension enabled by default, however, I can
What is the best way to check memory usage in an ASP.NET MVC3 application?
I am facing a problem while hosting my application over a AppHarbor. I’ve a

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.