When I was newbiee to ASP.Net, the a question click on my mind again and again, that why .Net provide it own web controls when there are HTML controls already exists.
After tossing through various tech site and blogs I finally got the answer and this makes my first entry to geekswithblogs.
Reason:
ASP.NET Web controls are adaptive in nature because of which they are sometimes called adaptive control.
By adaptive we mean their nature of rendering which depends upon the browser requeting .
For example if client browser IE 6.0 is requesting a page from server then it will render in HTML 4.0 compliant markup and say if same page is requested by Netscape browser then will render in HTML 3.5 complaint markup.
Let me explain it in more specific example by taking <asp:Label> contol into picture.
Server code contains the following line in page: <asp:Label ID="lblMessage" runat="server" ForeColor="red"> Label Text </asp:Label>
Now, when IE browser send request for the above label then the control will render in such way: <span id="lblMessage" style="color: red">Label Text</span> [this is HTML 4.0 compatible markup]
And if Netscape browser send the request then it will render in <span id=" lblMessage"><font color="red">Label Text</font></span> manner [this is HTML 3.2 compatible markup].
This makes ASP.Net more compatible with all the browsers but sometimes ASP.NET's default implementation can be a bit frustrating since for modern browsers - such as recent versions of Mozilla, Firefox, Netscape, and Opera - ASP.NET controls render, by default, HTML 3.2-compliant HTML rather than HTML 4.0-compliant HTML.
But we overcome this frustration by configuring your Web application (or the entire Web server) to render HTML 4.0-compliant HTML for these modern, non-Microsoft browsers.
I my next post I will explain on how to configure our site and application to render X.X-compliant markup.