views:

175

answers:

2

Hi guys, 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.

+1  A: 

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.

RichardOD
I am using the built in Web Server. Well using fiddler/firebug does not show any styles being applied. In the page source I do see the links added in the head :(.
theraneman
OK so the problem is some of your tags aren't rendered? Perhaps post some sample code. Are any other tags not rendered as expected? What does get rendered?
RichardOD
Look in fiddler/filebug in the "net" tabe, aer the files even loaded?
cdm9002
Do you see a request being made for your CSS file? Is that request successful (code 200)?
John Saunders
Thanks so much guys. The culprit was a HttpModule I was using to avoid the "Viewstate Mac invalid" error in MVC. This module (http://mvcfriendlymodule.codeplex.com/) is the one that caused the problem. I have left my comment in the discussion thread in codeplex for this module owner.
theraneman
Glad you got it sorted and it is good you have left a message in the discussion thread on codeplex.
RichardOD
A: 

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.

cdm9002