Name
Image
Synopsis
This class represents an Image control on a Web Forms page, which is used to display
any supported graphic (including .jpg
,
.bmp
, .gif
, and .png
files). To specify the picture that should appear in this control, set a URL to the
file by using the ImageUrl
property.
You can specify a string of AlternateText
, which will be displayed
in browsers that do not support graphics or if the picture file is not available. You
can also set a Font
for the alternate
text. Many browsers also show this text as a tooltip when the user positions the
mouse over the image.
An Image
control cannot capture mouse
clicks. To respond to image click events, use the ImageButton
control instead.
Public Class Image : Inherits WebControl ' Public Constructors Public Sub New() ' Public Instance Properties Overridable Public Property AlternateText As String Overrides Public Property Enabled As Boolean Overrides Public ReadOnly Property Font As FontInfo Overridable Public Property ImageAlign As ImageAlign Overridable Public Property ImageUrl As String ' Protected Instance Methods Overrides Protected Sub AddAttributesToRender( ByVal writer As System.Web.UI.HtmlTextWriter) Overrides Protected Sub RenderContents( ByVal writer As System.Web.UI.HtmlTextWriter) End Class
Hierarchy
System.Object→ System.Web.UI.Control(System.ComponentModel.IComponent
, System.IDisposable
, System.Web.UI.IParserAccessor
, System.Web.UI.IDataBindingsAccessor)→WebControl(System.Web.UI.IAttributeAccessor)→ Image
Get ASP.NET in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.