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...
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:
I also found that if the link is placed in the XAML, you have to replace the '&' sign with its '%26' counterpart.