Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i am trying to bind image if value is null but it is showing an error .

<%# Eval("Date")!=DBNull.Value ? "0" : <img src="Images/alert.png" alt="Null" /> %>
HTML



Please help..???
Posted
Comments
ashok rathod 3-Jul-14 6:26am    
can you please elaborate what error it is showing actually...
johannesnestler 3-Jul-14 7:02am    
I think you have a syntax error here, no quotes arround second argument?

1 solution

Try following:
HTML
<![CDATA[<%# Eval("Date")!=DBNull.Value ? "0" : "<img src='Images/alert.png' alt='Null' />" %>]]>
 
Share this answer
 
Comments
Amol Jadhao 8-Jul-14 4:43am    
thanks..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900