简体   繁体   中英

Silverlight - Image Not Loading from URI at Runtime?

I've added an image element to my Silverlight app, and while the image pulls right up when in design mode, it doesn't load at all when running the app.

Code is:

<Image Height="95" 
       HorizontalAlignment="Left" 
       Margin="12,541,0,0" 
       Name="imgBannerAd" 
       Stretch="Fill" 
       VerticalAlignment="Top" 
       Width="828" 
       Source="http://myurl.com/images/theimage.png" 
       />

What's the deal? I'd tried running the file via the local hard drive and localhost, neither has any effect.

I would check that

This occurs when you test your file using the Visual Studio generated test html file, loaded directly from disk.

If you create an Asp.Net application to host your Silverlight XAP, the problem should go away.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM