System.Web
1.0.5000.0
2.0.0.0
Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.
System.Web.UI.HtmlControls.HtmlControl
System.Web.UI.ControlBuilder(typeof(System.Web.UI.HtmlControls.HtmlEmptyTagControlBuilder))
Use this control to display an image on a Web page. The control can be programmatically manipulated to change the image displayed, the image size, and the alignment of the image relative to other page elements.
For a list of initial property values for an instance of , see the constructor.
Provides programmatic access for the HTML <img> element on the server.
Constructor
Use this constructor to create and initialize a new instance of the class.
The following table shows the initial property value for an instance of .
-
Property
Initial Value
-
The "img" literal string.
Initializes a new instance of the class.
1.0.5000.0
2.0.0.0
Property
System.String
To be added: an object of type 'string'
Use this property to specify the alignment of the image with respect to other elements on the Web page.
The following table represents the possible values.
-
Value
Description
-
left
The image is aligned on the left side of the Web page.
-
center
The image is aligned in the center of the Web page.
-
right
The image is aligned on the right side of the Web page.
-
top
Other elements in the Web page are aligned with the top edge of the image.
-
middle
Other elements in the Web page are aligned with the middle of the image.
-
bottom
Other elements in the Web page are aligned with the bottom edge of the image.
The center value might not work on all browsers. To center an image, wrap the control inside paragraph tags that contain the align attribute set to "center" (<p align= "center">).
Gets or sets the alignment of the image relative to other Web page elements.
1.0.5000.0
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.DefaultValue("")
Property
System.String
To be added: an object of type 'string'
Use this property to specify the caption displayed when the image specified by the property is unavailable. On newer browsers, this caption also appears as a ToolTip.
Gets or sets the alternative caption the browser displays if an image is unavailable or currently downloading and not yet finished.
1.0.5000.0
2.0.0.0
System.ComponentModel.Localizable(true)
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.DefaultValue("")
Property
System.Int32
To be added: an object of type 'int'
Use this property to create a frame with the specified width (in pixels) for an image.
Gets or sets the width of a frame for an image.
1.0.5000.0
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.DefaultValue(0)
Property
System.Int32
To be added: an object of type 'int'
The and properties can be used two ways. You can use the and properties to send image size specifications to the browser. This displays the Web page faster because the browser does not need to recalculate the positions of elements on the page when the image loads.
You can also use the and properties to scale the image. When using values different from the physical size of the image, the image is resized accordingly. However, this method for scaling the image is not recommended because it takes longer for the page to display it. Instead, physically resize the image to the size you need.
By default, the property is expressed in pixels, but it can also be expressed as a percentage of the size of the window.
Gets or sets the height of the image.
1.0.5000.0
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.DefaultValue(100)
Method
System.Void
a
If the value of the property is a malformed URL, the method throws an exception.
The method overrides the base class's method to write the attribute of the rendered control.
The method is used primarily by control developers extending the functionality of the control.
Renders the control's attributes to the specified object.
1.0.5000.0
2.0.0.0
Property
System.String
To be added: an object of type 'string'
Use this property to specify the path to the image file to display. If the image file is in the same directory as the Web page source file that uses it, you can just specify the file name. Otherwise, you must also include the path to the file. The path can be absolute or relative to the directory that contains the Web page source file. You can use the relative path " ~/ " to refer to the current virtual directory where the page is located. For example, the value of for <img runat="server" src="~/abc/d.gif"> on a page in the "XspTest" virtual directory is <img src="/XspText/abc/d.gif">.
Gets or sets the source of the image file to display.
1.0.5000.0
2.0.0.0
System.Web.UI.UrlProperty
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.DefaultValue("")
Property
System.Int32
To be added: an object of type 'int'
The and properties can be used two ways. You can use the and properties to send the image size specifications to the browser. This displays the Web page faster because the browser does not need to recalculate the positions of elements on the page when the image loads.
You can also use the and properties to scale the image. When using values that are different from the physical size of the image, the image is resized accordingly. However, this method for scaling the image is not recommended because it takes longer for the page to display it. Instead, physically resize the image to the size you need.
By default, the property is expressed in pixels, but it can also be expressed as a percentage of the window size.
Gets or sets the width of the image.
1.0.5000.0
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.DefaultValue(100)