Partilhar via


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

An ImageButton control allows you to present a picture as a clickable control.

NoteNote

If you want to create an image with clickable regions, you can use the ImageMap control.

To create a graphical button

  1. Type an <asp:ImageButton> element into the page.

  2. Set the button's ImageUrl property to point to an image file (for example, .gif or .jpg).

    You can point to an image file anywhere 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, see How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings.

See Also

Reference

Button Web Server Controls Overview