HTML and ASP.NET Server Controls
page 1 of 1
Published: 01 Nov 2003
Unedited - Community Contributed
Abstract
A comparison made between the two types of server controls.
by Haroon Malik
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 11058/ 13

When I started studying ASP .NET one of the things that confused me a lot were the two different forms of server controls (HTML and ASP .NET) which almost seem to do the same thing, but were in different namespaces and had a few different functionalities. Now after a long a thorough study of books and reference material I have been able to grasp the main idea of the difference between both of these controls and how and when which of these two should be used.

Let's take a minor touch of the basics first of all. ASP .NET provides us with not only these two controls, in fact it has a large library of controls that is not limited and can be expanded by creating our own controls or by adding up the third party controls that are available on the internet or through the CD's. We can categorize the server controls that are provided by ASP .NET to us as follows

  1. Intrinsic Controls
    These are the HTML based controls like Textbox, Text Area, etc.
     

  2. Data-Centric Controls
    These controls are specially designed for the database connectivity and provide the binding facility, e.g. List controls.
     

  3. Rich Controls
    Controls like the Calendar and Data Grid are examples of rich controls.
     

  4. Validation Controls
    These controls are provided for usage with the intrinsic controls and provide functionality of data validation.

I will not be going into the details of these controls as the main focus of discussion for this article is not based on these controls rather it is to help you in understanding the differences that exist between the HTML Server Controls and the ASP .NET Server Controls.

The confusion that I had, and I think some of you may also have, is that why provide two type of controls that almost provide similar functionality, i.e. that both the controls are executed on the server side, both the controls are providing nearly similar events and have similar usage when creating forms or other pages. All this is true that both controls are nearly similar, but they have a vast difference that exists between them. The ASP .NET Server Controls are more rich in functionality as compared to their HTML Server Control counterparts. Let's take a look at some other differences that exist between these controls.

  1. Control Abstraction:
    A HTML Server Control has similar abstraction with its corresponding HTML tag and offers no abstraction.

    ASP .NET Server Controls have higher level of abstraction. An output of an ASP .NET server control can be the result of many HTML tags that combine together to produce that control and its events.
     

  2. Object Model:
    The HTML Server Controls follow the HTML-centric object model.

    ASP .NET Server Controls
    have an object model different from the traditional HTML and even provide a set of properties and methods that can change the outlook and behavior of the controls.
     

  3. Browser Compatibility:
    The HTML Server Controls have no mechanism of identifying the capabilities of the client browser accessing the current page.

    ASP .NET Server Controls can however detect the target browser's capabilities and render themselves accordingly.

Despite the differences you can still use these controls together by mixing them in an ASPX form or page. These controls can also be used together in the build up of user controls that you can design according your requirements and needs. As far as the question which control to use when? is concerned, I would say that its up to you to decide that what you are comfortable with and what you can handle easily. If you want to convert your existing HTML based template pages to ASPX based pages then it would be better for you to convert the tagged HTML controls within them to HTML Server Controls as this would only require you to add the runat="server" attribute to them. If preparing new ASPX based template pages that you want to easily target browsers according to their capabilities, e.g. a page that can have the same view on a mobile phone as it has on the Internet Explorer, would require you to use the ASP .NET Server Controls.



User Comments

Title: html and server ctrl   
Name: velmurugan
Date: 2013-01-05 6:35:02 AM
Comment:
Thanks for your answer
Title: HTML and ASP.Net Server Controls   
Name: Dhananjay Kadam
Date: 2012-06-20 1:12:34 AM
Comment:
It is very very nice answer.I am confused from last 6 months,but i didnt understand differnce between asp.net control and html control.but thanks sir Today I understand all these things....................

Thank you
Title: ASP.Net and HTML   
Name: Priyadharshini
Date: 2012-03-27 4:51:19 AM
Comment:
It's nice.It useful for begineer of ASP.Net developers...
It easier to understand the concepts
Title: HTML and ASP.Net Server Controls   
Name: Vamsi
Date: 2011-11-24 2:25:08 AM
Comment:
It's good. But elobarating with example's may help the reader to understand more.
Anyhow, Thanks.
Title: HTML and ASP.Net Server Controls   
Name: Somsagar
Date: 2010-10-06 11:56:36 PM
Comment:
I was searching for a simplified answer. I am a beginner and this is sufficient for a start. Please keep posting articles like this. Shukriya dost.
Title: HTML and ASP.Net Server Controls   
Name: Madhan
Date: 2010-08-03 10:51:38 AM
Comment:
Its very nice.
Easier to understand the concepts.
thanks for your efforts
Title: HTML-centric object model   
Name: Syed Wasim
Date: 2009-05-24 4:35:41 AM
Comment:
The article is nice, but not quiet elaborate, it does does not cover the in depth functional differences, it will be good if this was demonstrated with 2 examples.
Title: HTML-centric object model   
Name: Harish vemunoori
Date: 2008-09-16 5:24:24 AM
Comment:
Article is quite good. But if it is supported with small examples, it might be more easy to understand..
Anyways thnQ.......
Title: HTML and ASP.NET Server Controls   
Name: john
Date: 2008-04-24 1:03:41 PM
Comment:
Appreciate..but it wud have been better if u wud have provided more insights....thanks anyways
Title: asp.net   
Name: vlad
Date: 2008-03-11 6:04:18 AM
Comment:
hello i like your article..
thank you..

--
vlad Alex
http://www.helion-prime.com
Title: re: server controls   
Name: software_serfer
Date: 2008-03-11 6:02:57 AM
Comment:
thank you for your article. it is usefull..
Title: Difference Between HTML server control and ASP.NET server control   
Name: Devjani Mondal
Date: 2007-10-30 1:11:41 AM
Comment:
Thanks for the article. I found the article very useful.
But 2nd point i.e. 'Object Model' should be explained with example.
Title: ASP.NET   
Name: Dipal Bhavsar
Date: 2007-10-16 2:55:55 AM
Comment:
It is very nice description, but we can implement it with some of the third party user control?

Thanks,
Dipal Bhavsar
dipal.bhavsar@gmail.com
Title: ASP.NET   
Name: Mohammad
Date: 2007-10-10 9:53:03 AM
Comment:
I found this article useful .. I didnt get the pt abt object model .. can u reflect more upon it .. if possible mail me at shaikh_studd@yahoo.co.in ..
Title: asp.net   
Name: BH.R.S.N.RAJU
Date: 2007-09-04 6:51:09 AM
Comment:
THIS ARTICLE IS NICE
THANK YOU
Title: asp.net   
Name: omnia mohamed
Date: 2007-03-13 2:51:03 PM
Comment:
the aricle is ok , iwant some titles of refrences in asp.net
please send it to manmona_ahmed@hotmail.com
Title: which to use when   
Name: abc
Date: 2006-11-09 1:45:28 AM
Comment:
All things in this article is ok but i want to know which control from these two types of control is faster in execution and the performance of which type of control is better.
Title: Wht abt Performance and Speed   
Name: Prashant Pandey
Date: 2006-11-07 10:50:31 PM
Comment:
Hello,
All things in this article is ok but i want to know which control from these two types of control is faster in execution and the performance of which type of control is better.
Title: FeebBack   
Name: Jignesh Maheshwari
Date: 2006-10-09 5:58:30 AM
Comment:
Hi Malik,
really nice artile.
keep it up.

Regards,
jignesh
Title: Feedback   
Name: xingyee
Date: 2006-10-02 10:54:17 AM
Comment:
Thanks a lot for the article. It really help me a lot.It gave me a clearer mind about differences between HTML and ASP.NET server controls. Thanks again... ^^
Title: Feedback   
Name: Keith
Date: 2006-09-27 4:02:27 PM
Comment:
I'm currently rebuilding a site that was html and asp to aspx. One thing that i'm finding hard is getting all the controls to stay aligned with each other. I'm using a master page set up and the content page does not put the server controls in the place where they were placed all the time.

The HTML stays put but the server side controls move to much. I have tried the absolute position as well but it is like it does not take in account that it is a content page not a regular aspx page.

I'm still looking for a good solution.

Keith
Title: Feedback   
Name: R.Srichand
Date: 2006-06-16 12:36:51 PM
Comment:
HI Malik,

It was nice reading ur article.Icame to know the major differences.
Title: FeedBack   
Name: Mughees Ahmed Javed
Date: 2006-03-21 1:29:40 AM
Comment:
Yes i did help me. But only with this explanation i am little reluctant to say, that i beginner of ASP.NET would understand the concept in a better way. But rather giving more details about the same would help him in the Basic Convept. But for the Experienced .NET/ASP Programmers it is definately holds good.
Title: Feed Back   
Name: Aparna
Date: 2005-07-04 2:31:04 AM
Comment:
Hi Haroon,

Thanks for this article,It is very good for beginers.
bye..
Aparna.G
Title: Feedback   
Name: Dhanesh Khanna
Date: 2005-03-31 6:31:25 AM
Comment:
Hi Haroon,
It was really nice to read this article. Can you please refeer me some good sites for ASP/HTML. i m a beginner for these terms and i m keen interested in Developement. Currently i m working as a web designer trainee and also i m doing some promotion kind of work. If you have some good suggestions then plz send it to dhanesh@cyfuture.com
Title: FeedBack   
Name: Ranjeet Sharma
Date: 2004-12-14 1:07:04 AM
Comment:
Thanks haroon for this nice article.Even i used to wonder about these till i read this article.
But there are still some doubts and i would like you to give me some refrences so that i could get the answers of my questions.
1.What is the difference in the object models of the two types of controls.
2.How does the server control get the browser information?
Regards
Ranjeet Sharma

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-19 6:46:00 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search