borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (asp.net dynamic page generate related question ?)Next Topic (how to pass encrypted query string ?) New Topic New Poll Post Reply
AndreaVB Forum : ASP.Net : difference between web server control and html server control in asp.net?
Poster Message
tri_inn
Level: Regular User
Registered: 26-08-2002
Posts: 395

icon difference between web server control and html server control in asp.net?

please tell me what is the difference between web server control and html server control in asp.net in detail.

29-12-2003 at 12:21 PM
View Profile Send Email to User Show All Posts | Quote Reply
zimcoder
Level: VB Lord


Registered: 27-10-2003
Posts: 225
icon Re: difference between web server control and html server control in asp.net?

Web Server Controls are group of controls derived directly from the System.Web.UI.WebControls base class. They are reusable components that can perform function as the ordinary HTML controls, the real advantage of web controls is that they are programmable.. ie they can treated and accessed the same way as any other .NET classes. They therefore repond to events, have methods /functions and can basically do all that other .NET classes can do. The main isuue to note is that the processing of these controls is done on the server. Consider:

<asp:Button id="MyButton" runat="server" Text="This is Zimcoder's button"/>


the key attribute is the "runat" which is set to the value "server" , this is their default value

Web Server Controls are rendered as standard html to client browsers thus abracting the functionality. They also make it easy to deal with complex controls such as the Calendar control which would be hell to implement in html!

HTML server controls map directly to html tags. They are defined in System.Web.UI.HtmlControls namespace. The base class is System.Web.UI.HtmlControls.HtmlControl. Html tags are converted to Html server controls by including the runat attribute in their declaration and setting it to server. Consider

<input type="button" id="mybutton" name="mybutton" value="click me" runat="server">

te only difference between this tag declaration and that of a normal html button tag is the runat attribute.

Although these two categories may have overlapping functionality and may be even used synonymously  they have important differences. such as

1)HTMl s conctrols offer one to one mapping with html tags .. no abstraction,  Web s controls do not necessarily map to any html tag .. eg calendar control.  

2)Html attributes are not stronly typed to html s controls.. web s controls have strongly typed attributes making for easier access to methods and properties of the base class.

3)Html s controls do not distinguish between browsers though are not always rendered in a predictable way across browsers.. Web s controls were designed with this in mind.

4)web server controls can be extended as the developer sees fit to come up with custom controls.. not so easily or intuitively doable with html s controls..

hope i have clarified one or two things



____________________________
BrainBench ADO.NET and ASP.NET Certified Developer

07-01-2004 at 03:30 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : ASP.Net : difference between web server control and html server control in asp.net?
Previous Topic (asp.net dynamic page generate related question ?)Next Topic (how to pass encrypted query string ?) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder