Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Image URL from Database with spaces doesn't work

Reply
Thread Tools

Image URL from Database with spaces doesn't work

 
 
Magnus Blomberg
Guest
Posts: n/a
 
      04-07-2005
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


 
Reply With Quote
 
 
 
 
recoil@community.nospam
Guest
Posts: n/a
 
      04-07-2005
%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.

 
Reply With Quote
 
 
 
 
Magnus Blomberg
Guest
Posts: n/a
 
      04-07-2005
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 ***
 
Reply With Quote
 
recoil@community.nospam
Guest
Posts: n/a
 
      04-12-2005
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
[CSS] how can I show spaces as spaces? Tomasz Chmielewski HTML 21 09-10-2009 06:43 PM
Re: How to trim a String trailing spaces, but not leading spaces? Roedy Green Java 3 09-14-2008 02:10 AM
Re: How to trim a String trailing spaces, but not leading spaces? John B. Matthews Java 4 09-12-2008 05:28 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57