Solved

asp.net image invalid format

Posted on 2014-12-03
6
139 Views
Last Modified: 2014-12-12
<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,
0
Comment
Question by:ITsolutionWizard
6 Comments
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 40478499
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.
0
 

Author Comment

by:ITsolutionWizard
ID: 40478527
actually, the image alert message is Parser Error Message: The server tag is not well formed.
0
 

Author Comment

by:ITsolutionWizard
ID: 40478529
the image file is existed so it is valid.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 26

Expert Comment

by:Shaun Kline
ID: 40478542
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>") %>.
0
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 40478544
Just because a file exist does not mean that the data it contains is correctly formatted for what the system expects.
0
 
LVL 78

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 40479984
remove the last \
http://www.google.com/UserData/VehicleImages/  doesn't work
http://www.google.com//UserData/VehicleImages/medium/Primary.jpg also  doesn't work

are you using google.com as a placeholder?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now