Skip to main content
Home Forums Silverlight Programming Report a Silverlight Bug Image URL cannot contain a backslash (\), even not when URLEncoded
0 replies. Latest Post by LocalJoost on May 17, 2008.
(0)
LocalJoost
Member
0 points
1 Posts
05-17-2008 8:31 AM |
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 out, 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