visual studio 2008 html中调用外部css文件,CSS文件沒有在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,

這可能聽起來有點奇怪,但是在我的母版頁中引用的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.

例如,您可能想嘗試刪除前導斜杠。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值