D
Darren
Hi there,
Recently I have changed languages from VB.NET to C#.
While in VB.NET, I wrote the below code to determine if a specific
product in a repeater control had an image. If so, it would display
the appropriate image; if not, would display a placeholder.gif.
I now need to convert the below code to C# and am having a brutal time
at it. I do understand the simple syntax behind using the ternary
operator
ie: (bBoolean)?(aImage)bImage), but for the life of me cannot make
the below code fly in C#.
<%# IIf(Container.DataItem("hasimage") = true, "<img
src='ProductImgSmall/" & Container.DataItem("prodid") ".gif'>",
"<img 'ProductImgSmall/PlaceHolder.gif' >") %></a>
Thanks in advance,
Darren
Recently I have changed languages from VB.NET to C#.
While in VB.NET, I wrote the below code to determine if a specific
product in a repeater control had an image. If so, it would display
the appropriate image; if not, would display a placeholder.gif.
I now need to convert the below code to C# and am having a brutal time
at it. I do understand the simple syntax behind using the ternary
operator
ie: (bBoolean)?(aImage)bImage), but for the life of me cannot make
the below code fly in C#.
<%# IIf(Container.DataItem("hasimage") = true, "<img
src='ProductImgSmall/" & Container.DataItem("prodid") ".gif'>",
"<img 'ProductImgSmall/PlaceHolder.gif' >") %></a>
Thanks in advance,
Darren