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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:22:51+00:00 2026-06-06T03:22:51+00:00

I have written an ASP.NET MVC3 Web application which runs perfectly inside the Visual

  • 0

I have written an ASP.NET MVC3 Web application which runs perfectly inside the Visual Studio development web server and run on a specific IIS web server.

I have successfully published the same web application on another IIS web server. It runs well except for a strange behavior.

My controller actions returns the content without problem, but the layout page isn’t rendered. I end up having only the content returned by the controller action.

What am I missing ?

  • 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-06T03:22:54+00:00Added an answer on June 6, 2026 at 3:22 am

    I bet you have hardcoded the urls to scripts and CSS in your view instead of using Url helpers. You wrote:

    <link href="/Content/Site.css")" rel="stylesheet" type="text/css" />
    

    instead of the correct way:

    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    

    or you wrote:

    <script src="/Scripts/jquery-1.5.1.min.js"" type="text/javascript"></script>
    

    instead of the correct way:

    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    

    Now go ahead and search for all places where you have hardcoded urls like this and replace them with urls generated by helpers.

    The reason why your site doesn’t work when deployed in IIS is because in IIS there’s a probably a virtual directory that you have to take into account. So the correct address is http://example.com/myappname/content/site.css whereas when running locally there’s no such directory http://localhost:1234/content/site.css.

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

Sidebar

Related Questions

I have an asp.net web application written in C# using a SQL Server 2008
I have an ASP.Net MVC3 web application written in C#. I have one ActionResult
I've written a simple web application using asp.net mvc3 and I have a login
I have a web application written in ASP.NEt/C# and javascript. It uses session variables.
I have in here an old web application written in ASP.Net 2.0 + AJAX.
I have an application written on ASP.NET MVC (V 1.0). The application runs on
I have a web-application written on ASP.NET MVC 3. On client side I used
I have a web application written in ASP.NET MVC 3 . This application have
I have a web application written in ASP .NET MVC 3. I'm using ACS
We have a web application written in ASP.NET for .NET 3.5, using standard 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.