views:

34

answers:

1

I'm trying to prevent Visual Studio from trying to validate my relative image URIs for a WebForms project, but I can't find a way to do it. So far, I can't find any kind of warning ID or category. The images can't be resolved because they are not 'included' in my project, even though they do exist in the file structure.

This is a large application, so I hesitate to just include thousands of images in my project when I would rather just suppress the warnings.

Any thoughts?

A: 

Try adding "~" to the URLs along with the runat="server" attribute to each link, and see if they resolve?

Example: <img src="~/images/somepic.jpg" alt="yada" runat="Server"></img>

I think there is a way to manipulate the schema in VS but I wouldn't take this approach. I think that the above syntax will work even if they are not "included" in the project - but I'm working from memory here! :-)

UPDATE:

If you look in C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas, you will see the schemas. I think it's the xhtml.xsd. In this file you will be able to find the settings for the img tag. Try updating:

<xs:attribute name="src" type="xs:string" use="required" />
IrishChieftain
I've tried using the ~ syntax but it doesn't work, even though the files are there. When I include them in the project, they suddenly resolve, but I don't want to use that approach.
Ed Altorfer