Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

How to: Add ImageButton Web Server Controls to a Web Forms Page (Visual Studio)

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.


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).


    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 noteSecurity 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.

See Also

Community Additions

© 2015 Microsoft