Go to DotNetFunda.com
 Online : 1377 |  Welcome, Guest!   Login
 
<<= Please see left side tutorials menu.

  • Download the OOPS, ASP.NET and ADO.NET Training Videos for FREE, click here.


Silverlight Tutorials | Report a Bug in the Tutorial

Interesting?   Share and Bookmark this

asp:Image control
Image control is used to place an image on the page.
 
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.

Its properties like BackColor, ForeColor, BorderColor, BorderStyle, BorderWidth, Height etc. are implemented through style properites of <img>.

Following are some important properties that are very useful.
ImageUrl Url of image location.
AlternetText Appears if image not loaded properly or if image is missing in the specified location.
Tooltip Text message Appearing on mouse over the image
ImageAlign Used to align the Text beside image.
DEMO : Label Show Source Code
If image is not loaded, AlternetText appears instead of the image
DotNetFunda Logo
If image loaded, on mouse over tooltip appears
DotNetFunda Logo This is DotNet Funda logo.
 
                        
            // 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.
                    
                    
There is one important but rarely used property of Label control is AssociatedControlID that is used to associate a Label with a particular Control. Like in this example, Click anywhere in the page except "Write something into the TextBox" in the demo box then click "Write something into the TextBox" and notice that Cursor is placed in the TextBox.




About Us | The Team | Advertise | Contact Us | Feedback | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found copied contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
All rights reserved to DotNetFunda.Com. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks.
(Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher)