Hi
I have the following code. It all works except that if the ImageDescription contains a null the page of course fails with an error. I am using a literal because the ImageDescription may actually have some html in it or just plain text.
Is it possible to preform some conditional logic on the value to either fill the text with a set of spaces or a default description like "No description available" for those records where the ImageDescription is null?
<telerik:RadRotator ID="RadRotator1" runat="server" DataSourceID="LinqDataSource1" |
Height="340px" Width="450px" ItemHeight="340px" ItemWidth="450px" FrameDuration="7000"> |
<ItemTemplate> |
<asp:Image ID="Image1" runat="server" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "ImageURL").ToString().Trim() %>' |
Style="height: auto; width: auto" /> |
</ItemTemplate> |
<ItemTemplate> |
<asp:Literal runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ImageDescription").ToString().Trim() %>'></asp:Literal> |
</ItemTemplate> |
</telerik:RadRotator> |
Thanks Paul