Image URL from Database with spaces doesn't work

Discussion in 'ASP .Net' started by Magnus Blomberg, Apr 7, 2005.

  1. Hello!

    I have a web that will get images url from a database.
    Then I set the ImageURL for a Image control to row("ImgPath").
    In the Database this is for example \\server1\path1\my image.jpg
    In the ImageURL this should then be file://server1/path1/my%20image.jpg (I
    think) but it becomes file://server1/path1/my%2520image.jpg

    When I put the address in the browser address field and removes the text 25
    in the path everything is working.

    Why is the text 25 added?!?! How to solve this?

    Best regards
    /Magnus
    Magnus Blomberg, Apr 7, 2005
    #1
    1. Advertising

  2. Magnus Blomberg

    Guest

    %25 is the hex for the %. You may need to UrlDecode your data prior to
    setting or storing it . i am not sure what exactly you are doing so you
    will need to see when it is applicable.
    , Apr 7, 2005
    #2
    1. Advertising

  3. Thanks for your answer!

    So it might be a bug here, since I'm using VS 2005 beta 1.
    It does some double converting or something?!!?

    I have a string surl with \\xx\xx xx.xxx which I set with the code
    Image1.ImageURL = surl

    The result becomes file://xx/xx%2520xx.xxx
    25 should not be there.

    How to use UrlDecode. I'm not familiar with that function?

    Best regards
    /Magnus



    *** Sent via Developersdex http://www.developersdex.com ***
    Magnus Blomberg, Apr 7, 2005
    #3
  4. Magnus Blomberg

    Guest

    Something like HttpUtility.UrlDecode(variable)
    with System.Web included.

    If that still does not work then you will need to do a replacement.
    merely converting all %2520 to %20 or " " (space) dpeneding upon what
    your specific requirements are.
    , Apr 12, 2005
    #4
    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. John B. Matthews
    Replies:
    4
    Views:
    647
    John B. Matthews
    Sep 12, 2008
  2. Roedy Green
    Replies:
    3
    Views:
    607
  3. Tomasz Chmielewski

    [CSS] how can I show spaces as spaces?

    Tomasz Chmielewski, Sep 5, 2009, in forum: HTML
    Replies:
    21
    Views:
    1,554
    Jan C. Faerber
    Sep 10, 2009
  4. Tomasz Chmielewski

    how can I show spaces as spaces, part 2

    Tomasz Chmielewski, Sep 9, 2009, in forum: HTML
    Replies:
    14
    Views:
    853
    Jan C. Faerber
    Sep 10, 2009
  5. johkar
    Replies:
    2
    Views:
    2,818
    Mayeul
    Dec 10, 2009
Loading...

Share This Page