Skip to main content

Microsoft Silverlight

Unanswered Question Image URL cannot contain a backslash (\), even not when URLEncodedRSS Feed

(0)

LocalJoost
LocalJoost

Member

Member

0 points

1 Posts

Image URL cannot contain a backslash (\), even not when URLEncoded

Hi,

I wrote a bit of code to download dynamically created images. The URL where like this:

string Url = "http://localhost:2872/blah/Some.aspx?Param=\\something\\or\\the\\other;"

map.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(Url));

Where map was defined as <Image Name="map" Height="280" Width="400"></Image> in my XAML

The page Some.aspx was not called by Silverlight al all (no breakpoint hit, no log messages). When I changed the backslash in the Param URL variable to %5c (backslash URLEncoded) it still did not call the page. Only when I removed every backslash and/%5c from the URL it worked. It took me the better part of 6 hours to figure this outTongue Tied, since I assumed the error was in my own image caching mechanism or lack of understanding of Silverlight. Anyway, I don't know if this a bug or a feature, but I think it's a good idea to mention it.

Have fun,

Joost

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities