HtmlDecode in <asp:image>

M

MRW

Hello!

I'm taking a file name from a database and using the <asp:image> tag in
GridView to show the image. However, some of the file names have
spaces in it and no matter what I do, for example:

<asp:Image runat=server ImageUrl=<%#
HttpUtility.HtmlDecode((Eval("WallpaperLink"))) %> />

It still displays the file as: bobs%20image. %20 keeps popping up.
Does anybody have any solutions?

Thanks for the help!
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

That is because the Image control encodes the url correctly. An url may
not contain spaces, so they should be encoded as %20.

If you want to produce an image tag with an incorrectly encoded url, you
have to write the html code yourself.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top