Skip to main content

Microsoft Silverlight

Answered Question Proper way to reference images via a hyperlinkButton's NavigateUri in Silverlight.RSS Feed

(0)

rusmo27
rusmo27

Member

Member

4 points

5 Posts

Proper way to reference images via a hyperlinkButton's NavigateUri in Silverlight.

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
preishuber

Contributor

Contributor

3570 points

655 Posts

Re: Proper way to reference images via a hyperlinkButton's NavigateUri in Silverlight.

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)

-Hannes

http://www.preishuber.net http://weblogs.asp.net/hpreishuber

rusmo27
rusmo27

Member

Member

4 points

5 Posts

Re: Proper way to reference images via a hyperlinkButton's NavigateUri in Silverlight.

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.

preishuber
preishuber

Contributor

Contributor

3570 points

655 Posts

Re: Proper way to reference images via a hyperlinkButton's NavigateUri in Silverlight.

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

-Hannes

http://www.preishuber.net http://weblogs.asp.net/hpreishuber

Mog Liang - MSFT
Mog Lian...

All-Star

All-Star

15894 points

1,541 Posts

Answered Question

Re: Proper way to reference images via a hyperlinkButton's NavigateUri in Silverlight.

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.

 

Mog Liang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities