I realize this is an edge case, but it seems that asp.net doesn't allow reading images from the root drive. To test this I wrote the following very simple application:
On the page I have:
<asp:Image ID="test" runat="server" />
In the code behind I have:
test.ImageUrl = @"C:\test\image.jpg";
test.AlternateText = File.ReadAllText(@"C:\test\text.txt");
Both files exist as you'd expect and have the correct permissions. When viewing the source of the page we get an img tag that looks like the following:
<img id="test" src="C:\test\image.jpg" alt="some text to read" style="border-width:0px;" />
When I run this in VS no image is displayed. If I copy the source, paste it into an html file and load it into a browser the image is displayed. Can anybody explain why this is?