If statement in repeater control

TainTeD

New Member
So depending on if the repeater item has a link or not I want to use a link around an image otherwise I just want to out put link.Right now I have\[code\]<asp:Repeater ID="BannerImageRepeater" runat="server"> <ItemTemplate> <a href="http://stackoverflow.com/questions/14073606/<%# ((BannerImage)Container.DataItem).CallToActionUrl %>"><img src="http://stackoverflow.com/questions/14073606/<%# ((BannerImage)Container.DataItem).ImageUrl %>?w=980&h=600" alt="<%# ((BannerImage)Container.DataItem).AltText %>"/></a> </ItemTemplate></asp:Repeater> \[/code\]So wanted to add something like\[code\]String.IsNullOrEmpty(((BannerImage)Container.DataItem).CallToActionUrl)<img src="">else<a href=''><img src=""></a>\[/code\]
 
Back
Top