System.Web.UI.WebControls.Image Class

Displays an image on a Web page.

See Also: Image Members


[System.ComponentModel.Designer("System.Web.UI.Design.WebControls.PreviewControlDesigner, System.Design, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")]
public class Image : WebControl


In this topic:


The System.Web.UI.WebControls.Image control lets you work with images from server code. Use the System.Web.UI.WebControls.Image control to display any valid image supported by the requesting browser on the Web page. The path to the displayed image is specified by setting the Image.ImageUrl property. You can specify the text to display in place of image when the image is not available by setting the Image.AlternateText property. The alignment of the image in relation to other elements on the Web page is specified by setting Image.ImageAlign property.


This control only displays an image. If you need to capture mouse clicks on the image, use the System.Web.UI.WebControls.ImageButton control.


For information about how to configure this control so that it generates markup that conforms to accessibility standards, see Accessibility in Visual Studio 2010 and ASP.NET 4 and ASP.NET Controls and Accessibility.

Declarative Syntax


    BackColor="color name|#dddddd"
    BorderColor="color name|#dddddd"


Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0,