Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Proper way to reference images via a hyperlinkButton's NavigateUri in Silverlight.
4 replies. Latest Post by Mog Liang - MSFT on July 20, 2009.
(0)
rusmo27
Member
4 points
5 Posts
07-13-2009 1:34 PM |
I have images that I wish to display that live on my web server outside of the directory structure of my Silverlight app. All the examples I've seen involve referencing images using paths that are relative to the location of the XAP file. For simplicity's sake, let's say that on my web server the XAP is being served up on the C drive and all my images exist in a folder on the D drive (D:\images\). What's the proper way to set the NavigateUri property on a HyperlinkButton so that the image is viewable in the browser? I'm also open to other ideas to accomplish this. Thanks, Will.
preishuber
Contributor
3570 points
655 Posts
07-13-2009 1:39 PM |
you have to set the propertys in solutuon explorer of the image file to "none".
2nd you have to place image in the same location as xap is loaded ( or subdirectory)
07-13-2009 2:11 PM |
Thanks for the quick response. It's the 2nd step that I have a problem with. The image files are uploaded to a different location. I don't think it's a good idea, or even reasonable, to have to permanently store images underneath the same webapp directory as the XAP. Surely, there must be another option. Thanks, Will.
07-13-2009 2:40 PM |
you can created subdirectory but you can not go one level higner in directory structure. If you access the image by network stack you can make a "cross domain" call. But then you have no caching from browser
Mog Lian...
All-Star
15894 points
1,541 Posts
07-20-2009 1:18 AM |
Hi,
Publish the image folder in iis, then your silverlight application could access images by http uri.
No cross-domain issue for using BitmapImage to access images.