Difference between ASP.NET Server Controls and HTML Server Controls

Hi

ASP.NET Server Controls

Advantages:

1. ASP .NET Server Controls can detect the target browser's capabilities and render themselves accordingly. No issues for compatibility issues of Browsers i.e page that might be used by both HTML 3.2 and HTML 4.0 browsers code is written in the Server Controls.

2. Newer set of controls that can be used in the same manner as any HTML control like Calender controls. Without any need of Activex Control without bringing up issues of Browser compatibility).

3. Processing would be done at the server side. In built functionality to check for few values(with Validation controls) so no need to choose between scripting language which would be incompatible with few browsers.

4. 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.

5. 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. Example Gridview or Form control.

Disadvantages:

1. The control of the code is inbuilt with the web server controls so you have no much of direct control on these controls

HTML Server Controls

Advantages:

1. The HTML Server Controls follow the HTML-centric object model. Model similar to  HTML

2. Here the controls can be made to interact with Client side scripting. Processing would be done at client as well as server depending on your code.

5. A HTML Server Control has similar abstraction with its corresponding HTML tag and offers no abstraction.

Disadvantages:

1. You would need to code for the browser compatibility.

2. The HTML Server Controls have no mechanism of identifying the capabilities of the client browser accessing the current page.

Vikram


Share this post   Email it |  digg it! |  reddit! |  bookmark it!

Feedback

Posted on 11/27/2007 12:19:09 AM

Couple of points. The point "you would need to code for browser compatibility" is true, but only to the extent that you were intending to add browser-specific client script to a control. Many things that you might do with client script can be written in a browser-agnostic way. (Not everything, of course.) The object model for HTML elements (hence HTML controls) is substantially the same between browsers, at least these days.

A second advantage of HTML controls, in one sense, is that you can turn any HTML element into an HTML control. With ASP.NET server controls, you're stuck with either the controls provided out of the box or with creating your own. Being able to add "runat='server'" to any HTML element essentially gives you server-based programmability over the DOM.

As for HTML controls not having access to the client browser capabilities, that is not completely true. You can read the browser agent string in any server-based code. (That's all that the page does when deciding on browser capabilities.)

Posted on 12/20/2007 10:19:46 AM

Sir,

I am Ganesh Tiwari, A newbee in .net world(though completed my C, C++, C#, ADO.net, ASP.net, MySQL). I love working on .net environment. I m also keen to know interesting fact abt programming and coding......got the same from ur site.

Thanks for such a gr8 site & effort. I m now a big fan of urs and only wish one thing from u to plz update your site as well with as much fact regarding dotnet.

Sir, if there's any query, I will surely put forward to you and even confident of getting the solution.

Thanks in Advance,
Regards

Ganesh Tiwari

Posted on 9/24/2008 3:12:05 AM

Hi,
If I want to use Menu control to generate simple UL and LIs. then will it be better to use html LI and UL controls itself?

Please post your comments:

Name:  
Email (optional): Your email address will not be posted.
URL (optional):
Comments: HTML will be ignored, URLs will be converted to hyperlinks  
Enter the text you see in the box:
 
Copyright © 2006 - 2008 Vikram Lakhotia