Link to home
Start Free TrialLog in
Avatar of ITsolutionWizard
ITsolutionWizardFlag for United States of America

asked on

asp.net image invalid format

<asp:Image runat="server" ID="coachImage" onerror="changeImage('-1.jpg')" Height="120px" CssClass="borderOnly"
           ImageUrl=http://www.google.com//UserData/VehicleImages/<%= Bind("VehicleID") %>/medium/Primary.jpg />
     

I have above image control in asp.net but it said invalid format. What is wrong and how to fix it?

Thanks,
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Hi ITsolutionWizard;

Not sure but because the error states, image invalid format, I would try using a different Image to see if the jpg image you are using is not bad.
Avatar of ITsolutionWizard

ASKER

actually, the image alert message is Parser Error Message: The server tag is not well formed.
the image file is existed so it is valid.
The ImageURL property should be enclosed in apostrophes so that the quotation marks in the BIND statement do not short circuit the property. Also, the BIND format is <%# Bind("<your field here>") %>.
Just because a file exist does not mean that the data it contains is correctly formatted for what the system expects.
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial