简体   繁体   中英

CSS file not getting downloaded in Visual Studio 2008 SP?

This might sound a little wierd, but all of a sudden the CSS and Javascript files referenced in my master page are not being downloaded while the page is being rendered. I am working on a ASP.NET MVC project and things were all fine like half an hour ago! Here is what I have in head section of the master page,

<link href="/Content/MyCSS.css" rel="stylesheet" type="text/css" />
<script src="/Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>

I can see the CSS class intellisense while designing pages. But in the page source I do not see these files being added. I can see the css being applied in the VS designer. I have tried restarting VS, restarting my machine too. Anyone else faced this situation before. I might go crazy now.

Sounds odd. I would use Microsoft Fiddler to see if that gives you any clues. Also are you using IIS or the built in Web server?

If you are using some kind of source control, you might also want to review your recent changes.

Check that your paths are correct. You can create a web app in a virtual directory off the root, so you path would be "/myapp/default.aspx", in which case your paths for your css and js would be wrong.

Try to avoid putting absolute paths in file references.

You may want to try and remove the leading slash, for example.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM