<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderHeader" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderForTitleAndIntro" Runat="Server">
<table width="100%" cellpadding="2" cellspacing="0">
<tr valign="top" class="ArticleTitle">
<td style="padding-left:10px;" valign="middle">
asp:Image control</td>
</tr>
<tr>
<td class="ArticleContents">
Image control is used to place an image on the page.
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderForContents" Runat="Server">
<div class="ArticleContents">
Ideally Image control is used to place an image on the page. When it is rendered on the page, it is implemented through <img /> HTML tag.
<p>
Its properties like <span class="DemoCP">BackColor, ForeColor, BorderColor, BorderStyle, BorderWidth, Height etc. </span>
are implemented through style properites of <img>.
</p>
Following are some important properties that are very useful.
<table width="100%" class="TutoPropPlaceHolder" border="1" cellpadding="2" cellspacing="1">
<tr>
<td class="DemoCP">ImageUrl</td>
<td>
Url of image location.
</td>
</tr>
<tr>
<td class="DemoCP">AlternetText</td>
<td>
Appears if image not loaded properly or if image is missing in the specified location.
</td>
</tr>
<tr>
<td class="DemoCP">Tooltip</td>
<td>
Text message Appearing on mouse over the image
</td>
</tr>
<tr>
<td class="DemoCP">ImageAlign</td>
<td>
Used to align the Text beside image.
</td>
</tr>
</table>
<!-- START - Demo Section -->
<table class="DemoPlaceHolder" border="1" cellpadding="2" cellspacing="4">
<tr>
<td class="DemoTitle">
DEMO : Label
</td>
<td align="right">
<a class="DemoShowSource" href="../../misc/codeviewer/default.aspx?pagename=~/tutorials/controls/image.aspx" target="_blank">Show Source Code</a>
</td>
</tr>
<tr>
<td>
If image is not loaded, AlternetText appears instead of the image<br />
<asp:Image ID="img1" runat="Server" ImageUrl="~/images/DotNetFunda.gif" AlternateText="DotNetFunda Logo"
ImageAlign="textTop" ToolTip="Go to DotNetFunda Home page" />
<hr style="size:1px;" />
If image loaded, on mouse over tooltip appears<br />
<asp:Image ID="Image1" runat="Server" ImageUrl="~/images/DotNetLogo.gif" AlternateText="DotNetFunda Logo"
ImageAlign="Middle" ToolTip="DotNetFunda Logo tooltip." /> This is DotNet Funda logo.
</td>
<td>
</td>
</tr>
<tr>
<td colspan="2">
<!-- START - Server Side Code -->
<pre>
// If image is not loaded, AlternetText appears instead of the image
<asp:Image ID="Image2" runat="Server" ImageUrl="~/images/DotNetFunda.gif" AlternateText="DotNetFunda Logo"
ImageAlign="textTop" ToolTip="Go to DotNetFunda Home page" />
<hr style="size:1px;" />
// If image loaded, on mouse over tooltip appears
<asp:Image ID="Image3" runat="Server" ImageUrl="~/images/DotNetLogo.gif" AlternateText="DotNetFunda Logo"
ImageAlign="Middle" ToolTip="DotNetFunda Logo tooltip." /> This is DotNet Funda logo.
</pre>
<!-- END - Server Side Code -->
</td>
</tr>
</table>
<!-- END - Demo Section -->
</div>
<br />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="PlaceHolderFooter" Runat="Server">
</asp:Content>
Go Top