Last post May 25, 2016 10:57 AM by PatriceSc
May 25, 2016 08:33 AM|asp.net4|LINK
I am trying to bind images to grid-view from path stored in database.
lets say path stored in database is
but when the image bind to grid view the path appears this format
what is causing that?
<asp:Image ID="imageControl" runat="server" ImageUrl='<%# Eval("Picture") %>' />
May 25, 2016 10:57 AM|PatriceSc|LINK
Seems you have an unwanted character "Carriage Return" control character in your stored string which is then encoded as %0D (see for example
http://www.w3schools.com/tags/ref_urlencode.asp for url encoding).
Is the image shown? If yes you may want to fix both the actual file name and your db data. If not more likely it is just an error in your data (something like UPDATE Picture SET picture=REPLACE(Picture,CHAR(13),'') WHERE Picture LIKE '%'+CHAR(13)+'%' would
delete this character from all names having it.