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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:06:05+00:00 2026-06-15T14:06:05+00:00

I have this code in an Index.cshtml file: @{ViewBag.Title = Home;} <link href=Home.css rel=stylesheet

  • 0

I have this code in an Index.cshtml file:

    @{ViewBag.Title = "Home";}
<link href="Home.css" rel="stylesheet" type="text/css"/>
<img id="logo" src="~/Content/Images/Logo.png" />

This file is a view in my ASP.NET MVC4 application.

When I run the web application, I can see that the source code adds the appropriate HTML around this, and also adds a reference to the ‘Content\Site.css’ file.

However, neither the Site.css file nor my own Home.css CSS file appear to be used when running the application. First of all, any edits I make to Site.css aren’t reflected when I view source when running the application, which is weird. I have saved everything and built the project before running it and checking out the source code through my browser.

Second of all, the CSS link to Home.css (which is in the same folder as my view) does not appear to be used. The HTML editor doesn’t have a problem with the file, and so indicates that the path is valid – but when I click on Home.css in my the source code editor on my browser, I get a 404 error, saying that the file doesn’t exist.

Any idea on what I am doing wrong here?

The actual image I am using here loads correctly.

  • 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-15T14:06:06+00:00Added an answer on June 15, 2026 at 2:06 pm

    the CSS link to Home.css (which is in the same folder
    as my view) does not appear to be used.

    The Views folder is restricted direct access to from the clients. So you should not be putting any CSS, javascript or images files inside it. They should reside in your ~/Content folder (or some other folder which is accessible from the clients). And then reference it like this:

    <link href="~/Content/Home.css" rel="stylesheet" type="text/css"/>
    

    As far as your first problem about ~/Content/Site.css is concerned, the stylesheet might be cached by the browser. Try clearing the cache. If you are running your application in Release mode and enabled Bundles, ASP.NET MVC 4 will automatically emit a cache response header so that the static resources included in the bundle get cached in the browser.

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

Sidebar

Related Questions

In my _Layout.cshtml file I have: <table id=myTable> <tr><td><ul><li id=id1><a href=@Url.Action(Index, Home)>Home</a></li> <li id=id2><a
I have this code in index.html file: $(function(){ $('a#link').live('click', function(e){ $(div#element).load(file.html); }); }); In
I have this simple code in my user_controller.rb file #listing all users def index
Suppose I have index.cshtml @{ ViewBag.Title = Index; } @model SomeModel @section JS{ content1
So I have this code (in http://localhost/index.html ): <input type=button value=Yea class=button /> with
I have this code in my index.php. In Mozilla its ok. But in Ie
I have this code: ie1.link(:text, /Exception:/) It is producing an error message which I
i have used this code in my index.php to get user facebook first name
I have this action method in C#: public ActionResult Index() { ViewBag.Message = Hello;
i did this code File Real.cs public ActionResult Index() { IList<Eventdata> liste = DATA2.Eventdata.GetEventdata();

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.