Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4065562
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:59:53+00:00 2026-05-20T15:59:53+00:00

I am trying to bind web address of an image (BigImageURL) with a image

  • 0

I am trying to bind web address of an image (BigImageURL) with a image control. It works fine mostly but for some images i am getting http 403 error (found out using fiddler) and obviously the image does not get displayed. I want to display a static image in case the http url is not resolved.

<Image x:Name="HoverImage" Source="{Binding BigImageURL}" />

I tried to write a converter

public class UriToImageSourceConverter : IValueConverter
{

    public object Convert(object value, Type targetType,object parameter, CultureInfo culture)
    {
        BitmapImage image = null;
        try
        {
             image = new BitmapImage(new Uri(value.ToString()));
        }
        catch (Exception ex)
        {
            image= new BitmapImage(new Uri("..<mydefaultimageUrl>.."));
        }
        return image;
    }

    ...
}

<Image x:Name="HoverImage" Source="{Binding BigImageURL,Converter={StaticResource myUriToImageSourceConverter}" />

didn’t work !!
Even though the image url was not accessible, the converter didn’t throw any exception. I don’t think it tries to resolve the address or read image stream while creating the BitmapImage

Tried setting up a FallbackValue but it didn’t work either.

 <Image x:Name="HoverImage" Source="{Binding BigImageURL,FallbackValue=DefaultUrl}"/>

Any pointers ??

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T15:59:54+00:00Added an answer on May 20, 2026 at 3:59 pm

    Actually you have to do something like this

     <Image x:Name="HoverImage" Source="{Binding BigImageURL}" 
            ImageFailed="HoverImage_ImageFailed" />
    

    and add event handler

        private void HoverImage_ImageFailed(object sender, ExceptionRoutedEventArgs e)
        {
            var expection = e.ErrorException; // Here we could know what happend
            HoverImage.Source = someDefaultUrl; // And here we add default Url...
        }
    

    In silverligth you have to handle not loader image and image exceptions with help of events… do not use databinding for that case..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to publish a web site . The publication works perfectly, but when
I've been unsuccessfully trying to bind a gridview through a web service, but nothing's
I'm trying to bind a list of data to a data grid, but can't
Hi I'm trying to bind data to a kendochart, but no bars are appearing
I'm trying to bind a TreeView control to the public folders the machine ASUS-PC
I'm trying to bind parameters in what I think is the correct way, but
When trying to use SPWeb.GetSiteData(SPSiteDataQuery) (Trying to bind some data to SPGridView), it throws
I want to bind some data gotten from a web service to a custom
I am trying to bind data from SQL to a repeater control. I have
I am trying to bind a collection to wpf TreeView control using data templates.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.