views:

21

answers:

1

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?

+1  A: 

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.

Kyle B.
The tilda `~` only works for server side controls. So you cannot use in a <link> tag or an <img> tag. You could use if you changed the <img> to an <asp:Image>. But you can't use in <link>.
Philip Smith
Thanks, Kyle. That did it.
Buggieboy