views:

100

answers:

1

Does anyone know what the Maximum URL length is in Silverlight (version 4 if it matters)? I know it is 2048 and basically infinite for Firefox (the two environments I have tested in), but Image requests fail for long Uri's. Anyone know the magic number (is it 256 the max filepath length?) It is considerably shorter than the 2048 for IE...

+2  A: 

According to the .NET framework library for Silverlight The Uri scheme can be 1024 while a complete Uri can be up to 65519 characters long. This is valid for both v3 and v4.

Hope this gives you some guidance.

EDIT

Okay, well after long testing, I managed to track down the limit for an image URL.

The scheme refers to the http part.

The whole URI cannot be longer than 2047 after which it seems to not load the image anymore. However, I could not find any official reasoning behind it.

The fact that you are getting AG_E_NETWORK_ERROR exceptions does not have anything to do with the length of the URI.

You can check however, if there are any illegal characters in your URI:

  • You can find the reserved characters in RFC2369 and see their web counterparts at w3schools

I also found that if the link is placed in the XAML, you have to replace the '&' sign with its '%26' counterpart.

Johannes
Then why do images with URI with URI's longer than 1024 fail with AG_E_NETWORK_ERROR?
Kris Erickson