SingingEels : Development Community & Resource

Login

Articles

  • ADO.NET (2)
  • ASP.NET (31)
  • LINQ (4)
  • Security (2)
  • Silverlight (2)
  • SQL (7)
  • Standards (5)
  • WCF (1)

Syndication

  • Articles RSS
  • Blogs RSS

Contribute

  • Our Authors List
  • Member Sign-Up
  • Suggestions Box

Silverlight 2 Beta 2 - Image Source Bug With QueryString Parameters

(Jun 30 2008 - 05:06:36 AM by Timothy Khouri) - [print blog post]

Recently, I've been working on an update to a feature for SingingEels while at the same time writing an article on how to build an "image manager" using Silverlight. Because we store images (and thumbnails) in our database, we retrieve them via their ID as a query string parameter. Example:

<a href="Images.aspx?ID=1234" />

This is some very simple code, and there are probably a million articles on how to dynamically retrieve images from a database and display them in a browser.

So, as I was converting our existing functionality into a Silverlight application, I ran into a strange bug. As of right now (Silverlight 2 Beta 2), if you put a query string property in the 'Source' of an 'Image', it'll get ignored. So, if this is your XAML:

<Image Source="Images.aspx?ID=1234" />

Then instead of sending a request to the entire URI, Silverlight chops off everything from the quetion mark onward. Here's a screen-shot of what actually came accross the wire. Notice that the URL doesn't include the query string (as if Silverlight is intentionally truncating it):

Silverlight 2 beta 2 bug with image source - truncating query string

Now, to show you that I'm not crazy (and how I got around this issue for my testing purposes). I changed my XAML a little bit to be the following:

<a href="Images.aspx/ID=1234" />

With this simple change in my URL, notice the URL that is being addressed:

Silverlight 2 beta 2 bug with image source - slash instead of question mark

Fix The Bug!

My intention for bringing this out isn't to slam Silverlight in any way. It's going to be a great product, and I'm loving it even now. My hope is that someone reads this (who is on the SL dev team), and says "oh yeah, I forgot to fix that"... and then hopefully... they do fix it before launch :)

You must be logged in to add comments. If you have not already done so, you can create an account here. If you already are a member, you first need to login before you can comment.

Developer / Architect / Author

Blog Archives

  • August 2008 - (3)
  • July 2008 - (1)
  • June 2008 - (3)
  • May 2008 - (2)
  • April 2008 - (2)
  • March 2008 - (4)
  • February 2008 - (2)
  • December 2007 - (2)
  • November 2007 - (1)
  • October 2007 - (4)
  • September 2007 - (9)
  • August 2007 - (7)

Related Ads

SingingEels.com as of Aug 21 2008 - 12:38:40 AM - (0.0625)