";
Label2.Text = "Hello Asp.net Website I am Label Control";
}
}
Step :3 Now Run the program(press F5) and press the click button.
output:-
Now you see browser source code,you will see Label control converted to HTML span tag
see it:
5.) PlaceHolder control:- It is known as container control in Asp.Net.It is mainly used to store the value of other controls.You can Add controls to a Web Form by using the Controls.Add() Method.
There are some steps to implement the PlaceHolder control on the Web Form which is given below:
Step :1 First Open Your Visual Studio-->File-->New-->Web Site-->Select ASP.NET Empty Web Site-->OK-->Open Solution Explorer-->Right Click on Web Site-->Add New Item -->Select Web Form--> click Add-->Now drag and drop PlaceHolder and Button control from Toolbox on the Web Form as Given below:
Step :2 Now Double click on Click button and write the following codes which is given below:
Step :3 Now Run The Program(Press F5) and Press the Click Button.
Output:
6. )HiddenField control:->It is used to display the value stored in the HiddenField control in the Label control.It stores the information in the form of Strings.
There are some steps to implement the HiddenField control on the Web Form which is given below:
Step :1 First Open Your Visual Studio-->File-->New-->Web Site-->Select ASP.NET Empty Web Site-->OK-->Open Solution Explorer-->Right Click on Web Site-->Add New Item -->Select Web Form--> click Add-->Now drag and drop HiddenField,TextBox,Label and Button control from Toolbox on the Web Form as Given below:
Step :2 Now Double click on Click button and write the following codes which is given below:
Step :3 Now Run The Program(Press F5) and Press the Click Button.
Output:
7. )FileUpload Control:->It is basically used to Upload the File on the server using SaveAs() method on the click Event.When user browse a File and after browse click the Upload button then File is automatically Upload on the Server.
There are some steps to implement the FileUpload control on the Web Form which is given below:
Step :1 First Open Your Visual Studio-->File-->New-->Web Site-->Select ASP.NET Empty Web Site-->OK-->Open Solution Explorer-->Right Click on Web Site-->Add New Item -->Select Web Form--> click Add-->Now drag and drop FileUpload,Label and Button control from Toolbox on the Web Form as Given below:
Step :2 Now Double click on Click button and write the following codes which is given below:
Step :3 Now Run The Program(Press F5) ,Browse File from your computer and Press the Click Button.
Output:
8. ) Image control:- >It is used to display an image on a web page.
Properties of Image control:-
There are some important properties of Image control controls.
Alternate Text:- It is used to display alternate text when the image is not present.
ImageAlign:-It is used to sets the alignment of image control on the web page.
ImageUrl:-It is used to sets the path to an image to display in the image control.
Font:-It is used to increase or decrease font of the image control text.
DescriptionUrl:-It is used to set the location to a detailed description for the image.
There are some steps to implement the Image control on the Web Form which is given below:
Step :1 First Open Your Visual Studio-->File-->New-->Web Site-->Select ASP.NET Empty Web Site-->OK-->Open Solution Explorer-->Right Click on Web Site-->Add New Item -->Select Web Form--> click Add-->Now drag and drop Image control from Toolbox on the Web Form as Given below:
Step :2 Now copy the Image from computer and paste in the Website folder as shown below:
Step :3 Now Go Image Property-->click on ImageUrl Property-->select your image.
You will see following output:
9. ) ImageButton control:->It is used to display the image on Button instead of text.Properties of ImageButton is same as Button property.
10. ) ImageMap control:->It is used to provide various links(hotspots) to navigate to other web page,depending on the place where the user clicks.
Properties of ImageMap Control:-
There are some important properties of ImageMap control.
Hotspots:-It obtains a group of Hotspot Object that is defined in a ImageMap.
Target:-It is used to sets target window to show the web page when the ImageMap control clicked.
Enabled:- It is used to sets a value indicating whether the control can respond to the user interaction.
There are some steps to implement the Image control on the Web Form which is given below:
Step :1 First Open Your Visual Studio-->File-->New-->Web Site-->Select ASP.NET Empty Web Site-->OK-->Open Solution Explorer-->Right Click on Web Site-->Add New Item -->Select Web Form--> click Add-->Now drag and drop ImageMap,ImageButton and Label control from Toolbox on the Web Form as Given below:
Step :2 Now copy the Image from computer and paste in the Website folder as shown below:
Step :3 Now Go properties of ImageMap and ImageButton and Select appropriate image by Clicking ImageUrl.
Step :4 Now go Properties of ImageMap control and select( Collection).Add new hotspots as shown below:
Step :5 Now Run the Program(Press F5) and Click the Image Button.
output:
Note:- I have implemented this Application with some controls,Download it and Implement on Your System One by one.
First open This application in Your Visual studio(copy whole Web Form and paste your website folder)-->Go Solution Explorer-->Right click on Web form Which you want to Run-->click Set As a Start Page.Then you can Easily Run Each Web page.
Click below for download whole application
Download