This topic demonstrates how to add alternate text that appears when the image is not available in the BinaryImage control.
Complete the following steps to add Alternate Text to the BinaryImage control.
Set the AlternateText property within the <cc1:C1BinaryImage>
tag to set alternate text for the BinaryImage control.
<cc1:C1BinaryImage ID="C1BinaryImage1" runat="server" AlternateText="Sorry! Image Unavailable" ImageUrl="~/C1.png" />
Add the following code to the Page_Load event, to add Alternate Text to the BinaryImage control.
To write code in C#
C# |
Copy Code
|
---|---|
C1BinaryImage1.AlternateText = "Sorry! Image Unavailable"; |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
C1BinaryImage1.AlternateText = "Sorry! Image Unavailable" |
The Alternate Text will be displayed, in case the image is not available.