ComponentOne BinaryImage for ASP.NET Web Forms
Explore Features / Image Settings / Alternate Text
In This Topic
    Alternate Text
    In This Topic

    This topic demonstrates how to add alternate text that appears when the image is not available in the BinaryImage control.

    In the Designer

    Complete the following steps to add Alternate Text to the BinaryImage control.

    1. Select the BinaryImage control and click the BinaryImage smart tag to open the BinaryImage Tasks Menu.
    2. Set the Alternate Text you want to display in place of the image.

    In Source View

    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" />

    In Code

    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"

    What You've Accomplished

    The Alternate Text will be displayed, in case the image is not available.