Avatar of ITsolutionWizard
ITsolutionWizard
Flag 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,
ASP.NET.NET ProgrammingC#

Avatar of undefined
Last Comment
David Johnson, CD

8/22/2022 - Mon
Fernando Soto

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.
ITsolutionWizard

ASKER
actually, the image alert message is Parser Error Message: The server tag is not well formed.
ITsolutionWizard

ASKER
the image file is existed so it is valid.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Shaun Kline

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>") %>.
Fernando Soto

Just because a file exist does not mean that the data it contains is correctly formatted for what the system expects.
ASKER CERTIFIED SOLUTION
David Johnson, CD

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question