ToolBox HTML Control HTMLImage

HTML Image Web Server Control

In ASP.NET environment,This article describes you how to work with HTML Image Control.In HTML environment, Image is an object that represents an embedded Image in an HTML form. The Image control in a HTML form contains all instance of an <img> tag.

The HTML Image control can be used to rendering the image onto the web page.and which can be supporting the file types such as .gif, .jpg, .png, etc.

There are several functions available to access the HTML Image.some of its funtions are as follows,

  • document.getElementById()
  • document.getElementByName()
Image Objects Properties
  • id -Sets or returns the id of a Image
  • border -Sets or returns the width of the Image border
  • align -Sets or returns how to align an image according to the surrounding text
  • alt - Sets or returns an alternate text to be displayed, if a browser cannot show an image
  • complete - Returns whether or not the browser has finished loading the image
  • height -Sets or returns the height of an image
  • width -Sets or returns the width of a Image
  • hspace -Sets or returns the white space on the left and right side of the image
  • isMap -Returns whether or not an image is a server-side image map
  • longDesc -Sets or returns a URL to a document containing a description of the image
  • lowsrc -Sets or returns a URL to a low-resolution version of an image
  • src -Sets or returns the URL of an image
  • useMap -Sets or returns the value of the usemap attribute of an client-side image map
  • vspace -Sets or returns the white space on the top and bottom of the image
  • title -Sets or returns an element's advisory title
  • className -Sets or returns the class attribute of an element

The following code snippets explains you the HTML Image in the web form.

in .aspx.cs page,

    
       void Image2_Click(object sender, EventArgs e) 
       {
          img1.Src="orange.jpg";
          img1.Height=300;
          img1.Width=250;
          img1.Border=7;
          img1.Align="left";
          img1.Alt="Image 2";
       }
        

in .aspx page,

 
<form id="Form2" runat="server">
        <h3>Example</h3>
        <center>
           <button id="btn1"
                  OnServerClick="img1_Click" 
                  runat="server">
          Image 1
          </button>
        </center>
        <br><br>
        <img id ="img1"
            Src="apple.jpg"
            Width="200"
            Height="150"
            Alt="Image 1"
            Border="5"
            Align="center" 
            runat=server/>
    </form>
 
Related Links

Posted by: Admin
Posted on: 9/18/2009 at 4:51 PM
Tags: , ,
Categories: Asp.net
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (7) | Post RSSRSS comment feed

Comments

Onlineatoz.net

Friday, September 18, 2009 4:56 PM

trackback

ToolBox HTML Control HTMLTextArea

ToolBox HTML Control HTMLTextArea

ugg boots People's Republic of China

Saturday, June 26, 2010 4:05 AM

ugg boots

Well , the view of the passage is totally correct ,your details is really  reasonable and  you <a href=" http://www.discountbootsonsale.co.uk/
" >wslmart.net </a> guy give us  valuable  informative post, I totally agree the standpoint of upstairs. I often surfing on this forum when I m free and I find there are so much good information we can learn in this forum!

cosmetic packaging People's Republic of China

Tuesday, June 29, 2010 8:48 AM

cosmetic packaging

fuel saver

fuel saver People's Republic of China

Tuesday, June 29, 2010 8:48 AM

fuel saver

Hi! For everybody please ! This site is a good site. Do not misuse it's content. We are happy to have it nice. please!

nfl jersey People's Republic of China

Thursday, July 01, 2010 3:06 AM

nfl jersey

Thanks for the info!!

puma shoes men People's Republic of China

Monday, July 19, 2010 10:44 AM

puma shoes men

dsdvgdf aRgt shy

nfl jersey People's Republic of China

Friday, July 23, 2010 9:06 AM

nfl jersey

Thanks for the info!!

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading