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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:10:46+00:00 2026-06-18T15:10:46+00:00

when running my mvc website locally (VS IIS) images are displayed correctly: css snippet:

  • 0

when running my mvc website locally (VS IIS) images are displayed correctly:

css snippet:

.sprites {
    background: transparent url(../images/sprites.png) no-repeat 0 0;
}

However, when the site is published to the server OR Local IIS (not VS IIS), images fail to load (giving invalid path)

the only way to display images correctly on the Server is to modify css files and instead of "../images/sprites.png" have "/content/images/sprites.png"

why is that?

  • 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-18T15:10:48+00:00Added an answer on June 18, 2026 at 3:10 pm

    I figured it out:

    MVC4 comes with \App_Start\BundleConfig.cs file which is used for minimizing css/js scripts.

    Whenever I published my website (RELEASE) it was calling \Content\css (minimized file) which contained paths to my images (“../images/etc..”), which was incorrect since css file was no longer WITHIN /Content/Styles/style.css but /Content/css (minimized version).

    I had to modify it:

    From:

    bundles.Add(new StyleBundle("~/Content/css").Include(
                            "~/Content/styles/all.css",
        ..
    

    To:

            bundles.Add(new StyleBundle("~/Content/styles/css").Include(
                    "~/Content/styles/all.css",
    

    ..

    and in my layout.cshtml:

    @Styles.Render("~/Content/styles/css")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've an ASP.NET MVC-2 Website, which is running perfect at my development machine(IIS-7, Win7).
I have an asp.net mvc app running on a local iis website that is
I am running a website using visual studio 2012 MVC .Net 4.5, IIS Express
Currently my website is based around MVC and the Entity Framework running against a
I am having trouble getting ASP.Net MVC 4 running on IIS 6. First, i
I have an ASP.NET MVC web application running in IIS as a subweb; let's
I have a website running on .NET 3.5 and ASP.NET MVC 2.0. I am
I have a website application running in it's own application pool on IIS 7.0.
running asp.net mvc website that has code that connects to oracle. Works fine on
New to MVC and have been running through the tutorials on the asp.net website.

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.