I have an Ad Rotator and the File contents are coming from a table column, the problem is sometime the File columns contents are image, sometimes text file or the column is empty. My question is how do I display a static image when there are no attachment images or the attachment is there but it's not an image, its a .txt file or .doc file.
<telerik:RadRotator ID="rrotAttachmentImages" runat="server"
RotatorType="CoverFlowButtons"
Height="250px" Width="700px"
ItemHeight="225px" ItemWidth="700px"
ScrollDuration="100" >
<ItemTemplate>
<asp:CheckBox ID="chkImageDefault" runat="server"
Text="Default Image" Visible='<%# Eval("Default").ToString() == "1" %>'></asp:CheckBox>
<asp:Label ID="lblImages_Comments" runat="server" Text="Comments:"></asp:Label>
<telerik:RadTextBox ID="rtxtImageComments" runat="server" Width="300px" Text='<%# Eval("Comments") %>' Enabled="false" ></telerik:RadTextBox>
<asp:Image runat="server" ID="Image" ImageUrl='<%# Eval("File") %>' AlternateText="Image"></asp:Image> </ItemTemplate> </telerik:RadRotator>
c# code: //get file attachments
IQueryable<TableName> IqryAttachments = DAL.GetFileAttachments(recordid, "somepagename");
rrotAttachmentImages.DataSource = IqryAttachments;
rrotAttachmentImages.DataBind();