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,
這可能聽起來有點奇怪,但是在我的母版頁中引用的CSS和Javascript文件在呈現頁面時沒有被下載。我正在開發一個ASP.NET MVC項目,半小時前的事情都很好!這是我在主頁的head部分中所擁有的,
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.
我可以在設計頁面時看到CSS類intellisense。但是在頁面源代碼中我沒有看到這些文件被添加。我可以看到在VS設計器中應用了css。我試過重啟VS,重新啟動我的機器。其他人以前都遇到過這種情況。我現在可能會發瘋
2 个解决方案
#1
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?
聽起來很奇怪。我會使用Microsoft Fiddler來查看是否能為您提供任何線索。您還使用IIS或內置Web服務器嗎?
If you are using some kind of source control, you might also want to review your recent changes.
如果您使用某種源代碼控制,則可能還需要查看最近的更改。
#2
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.
檢查您的路徑是否正確。您可以在根目錄下的虛擬目錄中創建Web應用程序,因此您的路徑將是“/myapp/default.aspx”,在這種情況下,您的css和js的路徑將是錯誤的。
Try to avoid putting absolute paths in file references.
盡量避免在文件引用中放置絕對路徑。
You may want to try and remove the leading slash, for example.
例如,您可能想嘗試刪除前導斜杠。