Export (0) Print
Expand All

How to: Add ImageButton Web Server Controls to a Web Forms Page

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

You can add an ImageButton Web server control to your Web Forms page when you want to display a picture, or image, as a hyperlink.

Note Note

To create an image with multiple clickable regions, you can use the ImageMap control. For details, see ImageMap Web Server Control Overview.

To add an ImageButton Web server control to a Web Forms page

  1. From the Standard tab of the Toolbox, drag an ImageButton Web server control onto the page.

  2. In the Appearance category of the Properties window, set the button's ImageUrl property to point to an image file (.gif, .jpg, and so on).

    Note Note

    Click the ellipsis (...) button in the ImageUrl property box to select an image using the Select Image dialog box.

    You can point to an image file anywhere by using a URL or UNC path.

    Security note Security Note

    The URL associated with an ImageButton control can be tampered with by a malicious user. For more information, How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings.

© 2014 Microsoft