Source view of IMAGE.ASPX
DotNet Funda: Code Viewer
image.aspx | image.aspx.cs
Close Window  
<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">&nbsp;</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 &lt;img /&gt; HTML tag.
        <p>
        Its properties like <span class="DemoCP">BackColor, ForeColor, BorderColor, BorderStyle, BorderWidth, Height etc. </span>
        are implemented through style properites of &lt;img&gt;. 
        </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>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <!-- START - Server Side Code -->
                    <pre>
                        
            // If image is not loaded, AlternetText appears instead of the image
            &lt;asp:Image ID="Image2" runat="Server" ImageUrl="~/images/DotNetFunda.gif" AlternateText="DotNetFunda Logo"
             ImageAlign="textTop" ToolTip="Go to DotNetFunda Home page" /&gt;
             &lt;hr style="size:1px;" /&gt;
             
             // If image loaded, on mouse over tooltip appears
            &lt;asp:Image ID="Image3" runat="Server" ImageUrl="~/images/DotNetLogo.gif" AlternateText="DotNetFunda Logo"
             ImageAlign="Middle" ToolTip="DotNetFunda Logo tooltip." /&gt; 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