proper way to encode URL for image control

Discussion in 'ASP .Net Web Controls' started by JerryK, Nov 23, 2004.

  1. JerryK

    JerryK Guest

    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
    JerryK, Nov 23, 2004
    #1
    1. Advertising

  2. 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
    >
    >
    Ken Cox [Microsoft MVP], Nov 23, 2004
    #2
    1. Advertising

  3. JerryK

    JerryK Guest

    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
    >>
    >>

    >
    JerryK, Nov 23, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gustavo Venturo

    Help with URL.Encode

    Gustavo Venturo, Sep 14, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    477
  2. Url-encode in DataList

    , Dec 19, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    506
  3. Francois Gagnon

    Problem with URL encode serialized object

    Francois Gagnon, Mar 2, 2004, in forum: Java
    Replies:
    1
    Views:
    814
    John C. Bollinger
    Mar 2, 2004
  4. Guest
    Replies:
    2
    Views:
    1,901
    Guest
    Aug 18, 2007
  5. Lloyd Zusman
    Replies:
    1
    Views:
    148
    Lloyd Zusman
    Feb 12, 2008
Loading...

Share This Page