html control, server control

what is the difference between html control, server control and web controls
0
Nishanth_S
2/6/2007 3:31:52 AM
asp.net.web-forms 93655 articles. 6 followers. Follow

2 Replies
794 Views

Similar Articles

[PageSpeed] 21

See this post -

http://forums.asp.net/thread/1553414.aspx

Though if using a templated control I would not use either unless I need the value of the control on postback. Simple use literals with bound attributes.

Rgds,

Martin.


Rgds,
Martin.

For the benefit of all users please mark any post answers as appropriate.
0
mokeefe
2/6/2007 4:11:37 AM

"A square is a rectangle, but a rectangle is not a square." 

 A 'Control' is the basis for all ASP controls.  It has certain properties and methods that other, more developed controls can "inherit" and alter.  One of these properties is "ID"; every control (web, server, html, etc.) has this property.  If you look at the object browser (View-->Object Browser, or View-->Other Windows--> Object browser, if you haven't used it before, or ctrl + alt + J), you can browse each item available to you.

Expand System.Web, Then expand System.Web.UI beneath that.  In here, you will find Control. Click on it, and all of the methods and properties are displayed in the right hand side of the screen.

Now, close system.web and expand System.Web.UI.WebControls.  Under here, you'll find WebControl.  Click on it.  If you notice in the lower-right side of the screen, the info tells you that WebControl inherits from control. This means that all of the properties and methods you saw under Control are also available to any WebControl.  If you look in the upper-right side of the screen, though, you won't see the "ID" property we saw earlier. To see inherited properties and methods, you need to browse the class's base types.  In the left side of the screen, expand WebControl, then expand the Base Types folder.  In here you'll find Control, which you can expand to view properties and methods.

 

To be concise, though, a server control is a control that is created server-side (through generated markup) rather than explicitly through HTML.  For example, if you manually type an <input /> tag, ASP will leave the tag as-is.  If you create an <asp:Textbox /> tag, ASP will generate the tag as an <input />, along with special coding and formatting so it knows what the control is.  If you create a standard html control, but place the runat="server" attribute in its tag, it becomes an HTML control. HTML controls are standard html markup, but have the ability to be created and easily manipulated on the server.

WebControls are controls that are prefaced with <asp: in the markup, and allow you to have greater control over elements without having to manually add attributes and/or javascript. For example, you can postback to the server and handle a Textbox's OnTextChanged() event rather than create a javascript onchange="" event and function declaration (which users can read with View->Source).  Attributes are available via namespaces, such as txtTextbox.ForeColor rather than document.getElementById(MyControlID).style.color for retrieving text color.

 


---------------------------------------
MCP - Web Based Client Development .NET 2.0
0
ps2goat
2/6/2007 4:30:07 AM
Reply:

Similar Artilces:

Web Form Server Controls Vs. HTML controls
Hi1. What is the difference between Web Form Server controls and HTML controls with runat="server" attribute.e.g. <input type="text" id="mytext" runat="server"> Vs. <asp:TextBox id="mytext" />2. Why we should not use the normal HTML control instead of Server Controls since HTML controls are rendered on client side the performance in using them will be much better that using Web form server controls. Pls. can somebody explain this.- Anand one thing i know. there are much more options for the web controls. and web controls are easier to use than the http controls. for exampl...

html server controls and web server controls
hello what is the difference between html server controls and web server controls? what is the main goal of converting html elements to html server controls , so why i can directly use the web server controls instead of converting process? thank you for the help and for the time If you convert a normal html control to a html server control then you can work with and reference it programmatically. MS advises using web controls where possible. But if your application uses vast amounts of html controls its far easier to just apply runat="server" than to re invent them a...

HTML Server Control or Web Server Control?
Hi, Being new to ASP.NET I have one thing confusing me much. 1. Whats the major difference between HTML Server Control and Web Server Control? 2. Whats the advantage of processing all the HTML Controls in Server? Server will not be overloaded with this? Which one should I use?..Plain HTML or HTML Server Control or Web Server Control? Thanks and Regards _________________ ASP 2 ASP.NET FYI: http://msdn.microsoft.com/msdnmag/issues/01/09/asp/toc.asp Colt Hi Colt, Thanks for the link. I personally prefer server controls - - there are so many more possi...

Difference between Web Server control and HTML Server control
 HI, I want to know what is the main difference between html server control and web server controls.Thanks in advanceVikram Vikram www.vikramlakhotia.comPlease mark the answer if it helped you  The difference is that html server controls have syntax and rendering closely mapped to html objects.  Where as web server controls have more relation to the .NET Framework. Web server controls have a richer and wider range of special purpose controls.  Calenders, tree views, etc.. If a post helps you please mark it as an answer.  Is that the only difference...

HTML Server Controls V/s. Web Server Controls?
How does one understand when to use HTML Server Controls & when to use Web Server Controls in a Web Form? In other words, when should HTML Server Controls be used & when should Web Server Controls be used in a Web Form?ThanksRON*********If you have an apple & I have an apple & we exchange our apples, then each of us will still have only 1 apple but if you have an idea & I have an idea & we exchange our ideas, then each of us will have 2 ideas Web Server Controls should always be used. HTML Server controls were meant so that a standard HTML page could ...

HTML Controls or Web Server Controls?
there are  2 different categories of controls in asp.net2.0, the HTML controls and WebServer controls, what are the differences in terms of usage? or in what circumstances each of these 2 categories should be used?Achievement provides the only real pleasure in life The HTML controls are primarily used when porting old ASP applications (or plain HTML) pages to ASP.NET. They are also sometimes used when you want to write large amounts of client-side JavaScript. The ASP.NET server-side controls are used when you want to write server-side code to get/set the values of the controls (but ...

HTML server control and web controls
I would like to know when to use HTML controls with runat=server and web controls? and what is the difference between these two thanksfeed the creative machine The biggeest difference is that you can access a control's properties in the code-behind if it contains 'runat=server'...If you have a label control that you will not need to change in any way, use the HTML control - if you will be changing the text of the label, you can add 'runat=server' to the HTML control or use the label server control... Just remember - to change the text of a label server control, you would co...

Web form Controls vs HTML controls
Hi, can anyone explain me the difference between Web Form Controls and HTML controls? What is their usability and disadvantages? Can i write code behind HTML controls?    Thanx in advance. Yes, you just have add "runat=server", in your HTML control. The Web Server Control, have more funtionality that the HTML controls. With Web Server Control, you can work easy with Data. Too, you have controls as AdRotator, WebCalendar and more... : http://samples.gotdotnet.com/quickstart/MCP Sergio Tarrillo Here are the Recommendations from Microsoft ....when to use 1 over the other...

HTML Controls vs Web Form Controls
Hi, I have a page with both controls (HTML and Web Form Controls). I am trying to use an html Calendar control and then get the date selected by the user and put into a Web form input field control. When I try to run this the HTML control cannot talk to the Web form control. Any ideas? Thanks. Can't you put some javascript in the HTML-control with which you assign the value to the ASP.NET Server control? Please post some code so I can help u. Kind Regards,ThaYoung1! Hi here is the Code. Also I added a web form text input control and an html text control and created a fu...

Web Server Control Containing another Web Server Control?
I'm building a web server control that needs to include functionality from 3rd party web server control, ASPNetMenu. My web server control needs to render ASPNetMenu at runtime to create a menu. I'd like to do this so that my control's parent ASPX page does not need to register ASPNetMenu or make any configuration changes as this should be done through my web server control. Does anybody have any suggestions on how to do this? Mike - Cache entire web sites at the client and server and keep cache current. Cache just got easier! There are two articles that you would want to be int...

How to add a Web server or HTML server controls (such as CheckBox) to the template in GridView and bind the controls to a data source.
How to add a Web server or HTML server controls (such as CheckBox) to the template in GridView and bind the controls to a data source. Normally, We can add a Web server or HTML server controls to the template in GridView control,just like the Code 1I hope to do the same thing by programming (just like the Code 2), but I can ony add the BoundField,I don't know how to add a CheckBox control to the template in GridView , could you help me? //--------------------------------------------Code 1------------------------------------------------------------<asp:GridView AutoGenerateColumns="False...

how to have both server controls and html controls rendered in a custom control?
I have a custom control in which there is an html text box.when you click on it , a div containing a table is appeared and according to what you select in that table a text is set to the text box. It works fine but the problem is: as the text box is an html element it doesn't have viewstate and when a post back occures in the page its value disappeares.I tried a hidden field to keep its value.again there is another problem : I put this custom control in a usercontrol and put the usercontrol in a multiview and by clicking on a button this view is selected and by clicking another bu...

Actual difference between a HTML Server Control and a Web Control
Hi, I have a primitve doubt - what is the precise difference between a HTML control with runat= server  and an ASP.NET web server control.i think i read its something to do with how events are fired and so on but am not very clear...i want to know all the differences at the lifecycle level as well as from the usage point of view.Thanks Thanks and RegardsNirumaThe difference between try and triumph is just a little umph! HTML controls are quick & light, while web controls are more feature rich.Here are more details about the differences between HTML controls and web controls:http:...

Controlling web control instances on Web Form
I have created a composite control, extending functionality of the Hidden Control. However, I would like to prevent the user from adding this control to the page multiple times. I only want one instance of the control on the Web Form. What setting in my project to I adjust to enable this functionality? I can not find it in any of the books that I have referenced. Is this a setting or is this code that has to be added to the inheriting class. Looks like there is no standard apporach. But I'd consider using static field to count number of created objects and throw exception if second object ...

Convert a html table control to a Table Web Server Control
How Convert a html table control to a Table Web Server Control? add runat="server" attribute to the <table> tag...

Web resources about - html control, server control - asp.net.web-forms

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

ConnectSense Smart Outlet lets Siri control two HomeKit Wi-Fi wall sockets, USB charge iPads
... “smart plugs” previously released by iHome , ConnectSense has debuted the Smart Outlet with Apple HomeKit ($80) , which combines two Siri-controlled ...

How effective are parental controls for your child's safety?
... situation. Parents need to find ways to protect their children when they are not around to monitor it themselves. The Use of Parental Controls ...

Larwyn's Linx: Gun Control Group Calls For Obama To Declare “State of Emergency,” Ban Guns
Send us tips ! Bloggers: install a Larwyn's Linx widget . Get real-time news, 24/7, at BadBlue . Nation Gun Control Group: Obama Must Declare ...

San Bernardino shooting and the politics of gun control
"It's not enough to keep lamenting these things," Democratic Sen.

Kylie Jenner & her very thin Greyhounds were investigated by Animal Control
... healthy (you can see some screencaps from the Snapchats here ). So… Kylie was investigated by the LA County Department of Animal Care and Control. ...

Windows 10 vs. OS X: Which gives sys admins more control?
Now, nearly everything can be managed as if it were a mobile device, using APIs at the operating system for assured reach and consistent implementation ...

Assad Takes Control Of ‘Capital Of The Revolution’
Another victory for the Syrian government coming weeks after the regime regained control of Kuweires airbase.

Your opinion on gun control doesn't matter
... will die by guns than in car accidents this year. In practice, this is a public health crisis. If you still bristle at the idea of gun control, ...

Chinese Hacker Group Uses Dropbox for Malware Command and Control
NEWS ANALYSIS: The current malware threat isn't targeting U.S. interests now, but the hacker group could easily turn its attention in that direction ...

Resources last updated: 12/3/2015 3:47:11 PM