I've created a new web application project in Visual Studio 2008, and then copied in some code from a project created with an older VS version. For instance, I'll add a new web form item in my project, say, "Shop.aspx". Then copy the older code into the new file. The trouble is that referenced supporting files get a "not found" warning.
So, I'll have a line in the .aspx like:
<link media="all" href="ShopStyle.css" type="text/css" rel="stylesheet" />
The file ShopStyle.css resides开发者_开发技巧 in the same root folder of my project as Shop.aspx, but I get a "not found" warning about it. Or I'll have something like
<img alt="" src="Images/Navbar/MainLogoImage.gif" height="54"/>
Where MainLogoImage.gif is in the "Images/Navbar/" subfolder of my project folder and I get the same warning.
I've made sure that I added all of these existing items into my project in Solution Explorer. Why aren't they found?
Have you tried placing the '~' character at the front of the path? i.e. ~/ShopStyle.css or ~Images/NavBar/MainLogoImage.gif.... I'm not sure why it does this (perhaps someone could enlighten me) but that has worked for me.
精彩评论