How to use Image Control in ASP.NET

How to use Image Control in ASP.NET

0 367

How to use Image Control in ASP.NET

In my previous article I have described about Label Control, Button Control, CheckBox, CheckBoxList, RadioButton, RadioButtonList, ListBox and many other controls. In this article I will describe that How to use Image Control in ASP.NET.

What is Image Control

Image Control is a standard control which resides in Toolbox in Visual Studio (VS) Framework. This control is simply used to insert any image in the web form. To insert image control simply double click on it or drag it in your web form. When you insert this control then following coding appears in your source page.



This is the default coding which appears. In the above coding the ID of the control is a unique identifier which can be modified by you as per your desire, but remember the new identifier which you want to set must be unique. Now Follow the following steps that how to insert image in the web form.

Steps to Insert Image in the Web Form

  1. To use Image Control to insert image in your web page first you have to upload any image in the root directory or any other directory. For instance we create a directory (folder) namely images for this purpose. For this right click on Solution name in your VS Framework and the click on new folder, there you may insert any desired name (e.g. images) and then press enter. Now again right click on this folder and then click on add existing item to insert images from your system. (Also view this video)




  1. ImageUrl Property: This property is used to insert the desired image to your web form. To insert the image give the path of the image to this property. Watch the following video also.





  1. AlternateText Property: This property is used to set alternate text for the image. This is very useful property and one must add this property. You may type the text related to the image in this propery. If you insert a home image then the text may be “this is an image of home”. This is useful for On Page SEO purpose.


That is all about image control in brief. We will come back with more useful article very soon for you.


Leave a Reply