proper way to encode URL for image control

I have a page with an image control and I am trying to set the source to the
image file name "/images/products/image #45-7 picture.jpg" I have tried
setting the name directly and with URLEncode. In both cases, the image
cannot be found. What am I doing wrong?

Advertisements

I suspect the # in the name is going to give you trouble. Try escaping
with HTMLEncode or replacing it with a letter or number.

"JerryK" <> wrote in message
news:...
> HI,
>
> I have a page with an image control and I am trying to set the source to
> the image file name "/images/products/image #45-7 picture.jpg" I have
> tried setting the name directly and with URLEncode. In both cases, the
> image cannot be found. What am I doing wrong?
>
> Thanks,
>
> jerry
>
>

Advertisements

Unfortunately changing the name is not an option. The name is also stored
in a database that we reference, but cannot alter.

"Ken Cox [Microsoft MVP]" <> wrote in message
news:...
> I suspect the # in the name is going to give you trouble. Try escaping
> with HTMLEncode or replacing it with a letter or number.
>
> "JerryK" <> wrote in message
> news:...
>> HI,
>>
>> I have a page with an image control and I am trying to set the source to
>> the image file name "/images/products/image #45-7 picture.jpg" I have
>> tried setting the name directly and with URLEncode. In both cases, the
>> image cannot be found. What am I doing wrong?
>>
>> Thanks,
>>
>> jerry
>>
>>
>

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!