Default child controls in any web page in the asp.net

Rajkatie
Posted by in ASP.NET category on for Intermediate level | Points: 250 | Views : 5717 red flag
Rating: 4.5 out of 5  
 4 vote(s)

Hope this article helps you to increase your .net internal knowledge.

Introduction

In this article, I am going to demonstrate you default server child control that a single web page contains.


Objective

To learn the controls that a single web page contains by default.

Using the code

As developer we have worked lot of times with web page containing simple control like textbox to complex control like grid control, etc; but ever wonder how many default child controls does a single web page contains without putting any in-built control in web page.

In this article, we will find out control name and its type. Let us get started.

Step 1: create new website and write following line in Page_Load event


Step 2: run the website, it gives following output


Step 3: Now modified the above code for finding out child controls type.

 

Step 4: Now, run the web site and browser will show below output .

 

 

Step 5:  Its shows there are 3 literal controls, one htmlhead control and last one is htmlform control. Two child controls like form and head are obvious means we can find them out easily but what about other 3 literal controls.

Step 6: Blow are all five child control names

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

2. <head><title></title></head>

3.<body>


 

4. <form name="form1" method="post" action="Default.aspx" id="form1"><div>

<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="" />

</div>  </form>

5. </body></html>

Mostly above are the default five child controls present in single web page but in case of  removing  runat attribute from <head> tag, the count will be 4.

 

Page copy protected against web site content infringement by Copyscape

About the Author

Rajkatie
Full Name: Rajesh Patel
Member Level: Gold
Member Status: Member,MVP
Member Since: 2/14/2012 4:06:42 AM
Country: India
Rajesh Patel .Net Trainer(MSCD | MCT | MS) Brainbench (Asp.Net 4.5 and C# 5.0)
http://www.dotnetfunda.com/profile/rajkatie.aspx
I am Microsoft Certified Trainer. Over 9 years of professional in ASP.Net technology. Currently provides training and consulting services on web technologies such as jQuery,AngularJs,ASP.Net MVC,HTML5 and SQL Server to many developers of fortune IT organizations,College students

Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)