Hi

I have a datalist in which i am checking that if product have image then display its image other wise display no image through if condition but its not working.

<img src='<%# !String.IsNullOrEmpty(Eval("Companylogo").ToString()) ? "../adspictures/no-logo.jpg": "../adspictures/" + Eval("Companylogo")  %>'/>

It always displays no-logo. Tell me what am i doing wrong.

Thanks

mani-hellboy commented: reply what he/she asked then only we can process your request moreover +0

You better debug it. Try to print out the "Companylogo" datafield, see what its value. Check the desired image URL, simply assign it to any img tag and see either it shows up or not. etc

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.