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

  • Home
  • SEARCH
  • 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 629931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:48:03+00:00 2026-05-13T19:48:03+00:00

I have an Asp.net MVC2 web application. I built the application using VS2008 and

  • 0

I have an Asp.net MVC2 web application. I built the application using VS2008 and tested on internal server, everything was perfect but when I deployed that web application on a local IIS the paths to images in web pages and in CSS file was not correct.

I need to change those paths for working with internal server and local server.
How can I overcome this problem?

  • 1 1 Answer
  • 1 View
  • 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-13T19:48:03+00:00Added an answer on May 13, 2026 at 7:48 pm

    Have you tried opening the CSS and Images directly (i.e. not via being called on a page)? Does that work?

    How do you link to them on your internal server, if the relative paths don’t equate the same, you’ll have the problem you describe. An example about how you might fix this is to use Url.Content().

    e.g. Instead of using:

    <link rel="Stylesheet" href="/Styles/Reset.css" />
    

    You would use:

    <link rel="Stylesheet" href="<%=Url.Content("~/Styles/Reset.css")%>" />
    

    This would work out the URL depending upon where the application lives on that box – not relative for the web root.

    Edit: In case you need to do this through C# code

    // This can be used to create img tag
    public static string Image(this HtmlHelper helper)
    {
        UrlHelper urlHelper = ((Controller)helper.ViewContext.Controller).Url;
        TagBuilder imgTag = new TagBuilder("img");
        imgTag.MergeAttribute("src", urlHelper.Content("~/Content/images/image.gif"));
        imgTag.MergeAttribute("alt", "Alt text");
    
        return imgTag.ToString(TagRenderMode.SelfClosing);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the scenario: ASP.NET MVC2 Web Application Entity Framework 4 (Pure POCO's, Custom Data
I have a hybrid asp.net web forms / mvc application that I recently converted
I want to structure my ASP.NET MVC 2 web application sensibly using Areas. The
I have a Bootstrapper that looks through all Assemblies in an ASP.NET MVC application
How do I debug code in the View in asp.net mvc2 application? Edit after
I have written a VERY simple MVC application which just displays a single string
I'm in the process of designing the architecture of an application I’m planning on
I am creating a simple web site to get more familiar with MVC 2.0.
I have a Windows Form project that I would like to migrate toward a
First post inhere ever. So better make it a good one. I have 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.