lulu50
asked on
if then in MVC
Hi,
I need to say if the item.ImageName is null or empty display the default image.
not sure what I am doing wrong.
Here's my code.
Thanks,
<img src="@Url.Content("~/Conte nt/Uploade dImages/" + String.IsNullOrEmpty(item. ImageName) ? "NO-IMAGE.png" : item.ImageName)" />
I want to do this
if item.ImageName is empty then display the no-image.png otherwise display the image name.
I need to say if the item.ImageName is null or empty display the default image.
not sure what I am doing wrong.
Here's my code.
Thanks,
<img src="@Url.Content("~/Conte
I want to do this
if item.ImageName is empty then display the no-image.png otherwise display the image name.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER