System.Web.UI.HtmlControls.HtmlInputImage.Src Property

Gets or sets the location of the image file.

Syntax

[System.Web.UI.UrlProperty]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.DefaultValue("")]
public string Src { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the HtmlInputImage.Src property to specify the location of the image to display in the System.Web.UI.HtmlControls.HtmlInputImage control. If the image is not available, the text specified in the HtmlInputImage.Alt property is displayed.

You can use a relative or absolute URL. A relative URL relates the location of the image to the location of the Web page without specifying a complete path on the server. The path is relative to the location of the Web page. This makes it easier to move the entire site to another directory on the server without updating the path to the image in code. You can use the relative path " ~/ " to refer to the current virtual directory where the page is located. For example, the value of HtmlInputImage.Src for <input type="image" runat="server" src="~/abc/d.gif"> on a page in the "XspTest" virtual directory is <input type="image" src="/XspText/abc/d.gif">. An absolute URL provides the complete path. Therefore, moving the site to another directory requires that you update the code.

Requirements

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