Web Form Server Controls Vs. HTML controls

Hi

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

0
anandc
6/10/2005 12:32:59 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

5 Replies
1404 Views

Similar Articles

[PageSpeed] 19

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 example, you wouldn't want to use html table(or even webcontrol table) if datagrid/datalist/repeater can be used.

i don't think rendering performance would make a big difference, the number of controls on a page is very limited.

0
cyberguest
6/10/2005 1:03:53 PM
 anandc wrote:

Hi

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



Also note that purpose of Web Controls is to provide better abstraction to the underlying rendering mechanism /(be it HTML or XHTML), so they basically work in all browsers (if being strict depends on the implementation and support in the platform). HTML controls again are tied to the HTML presentation model as such.
Thanks,

Teemu Keiski
Finland, EU
0
joteke
6/10/2005 1:08:10 PM

Web Form Server Controls offers advantage in terms of their ability to generate the response depending upon the browser/client. And also that we can write the validation code for them in the same language as we use for writing business logic.  Earlier we all use to write JavaScript code for validations (now this will be reduced to minimum).

But the disadvantage what I think is that:

1. Previously the web designers used to design the look & feel for the pages be it a Data Entry Forms or simple content using HTML, DHTML, CSS etc.  But now they will have to learn ASP.Net syntax to design the pages using Web Form Server Controls.

2. As I wrote earlier, simple HTML pages/Forms can be rendered at the client side (by the browser) and does not hit the ASP engine.  But if we use Server Controls in ASP.Net each page having even single Server Control will hit the ASP.Net engine.  I'm not sure of how much is the performance impact of this. Is it so negligible that we can safely ignore it??

I am sorry if I'm being very detailed in my writing, but would appreciate a detailed reply.

Thanks for your comments....

- Anand

0
anandc
6/13/2005 10:11:48 AM
 anandc wrote:

1. Previously the web designers used to design the look & feel for the pages be it a Data Entry Forms or simple content using HTML, DHTML, CSS etc.  But now they will have to learn ASP.Net syntax to design the pages using Web Form Server Controls.



Yes, but that syntax is pretty much same despite the browser as might not be the case with pure HTML (there's always learning curve to everything). To do something more tied to the browser, that's what you have HTML control for, though Web controls are very very flexible and modifiable (for example with Attributes property). They are not perfect (not even near :-) ), but they also provide features that do not exist in normal HTML controls.

 anandc wrote:

2. As I wrote earlier, simple HTML pages/Forms can be rendered at the client side (by the browser) and does not hit the ASP engine.  But if we use Server Controls in ASP.Net each page having even single Server Control will hit the ASP.Net engine.  I'm not sure of how much is the performance impact of this. Is it so negligible that we can safely ignore it??


It has been designed performance in mind. Of course, more you add work to the server, more it means burden for it (and consumes CPU & memory) however remember that .NET languages are compiled before execution, which means compiler can do optimizations. Another thing to note is that object creation is very very efficient in .NET Framework (ASP.NET works so that Page and all controls are recreated for every request, design decision indicating also that ASP.NET team trusts the Framework's performance capabilities). 

You are able to get performance problems, if you have say very large DataGrid's controls (or generally data-bound controls) when the state carried along with the Page becomes large. They tend to slow down the Page much more than just having lots of controls. I've rarely seen cases where just having lots of controls on the Page would be the perf problem alone, there's always been something else behind the problems too.

So key point is that you can use server controls when they are suitable for the task (etc when they are needed to do it in efficient manner). If they are not needed for the scenario, then of course, no reason to use them. They should not be used if they are not required however I wouldn't "fear" using them when they solve the problems we usually face in web development.

And of course, remember that there's also caching (page output, data) capabilities in ASP.NET which allow you to increase the performance of your pages.


Thanks,

Teemu Keiski
Finland, EU
0
joteke
6/13/2005 4:17:39 PM
Hi Teemu Keiski

Thanks for your detailed reply.....I hope that ASP.Net team has given enough consideration to Performance of ASP.Net application.  Since I have worked on highly transactional websites, there are lots of performance related issues that arises when the number of users & request increases. And unless you are very much expert in Performance Optmization techniques you don't get the solutions for such problems.

And also the fact that Microsoft Products in the aim of giving very user-friendly and flexible user interface has brought in many memory leak issues.

- Anand
0
anandc
6/14/2005 8:22:45 AM
Reply:

Similar Artilces:

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

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

How to access a control on a web form from anoter web form
hi all I have this scenarios i have two web forms, one called form1 and the other called form2 form1 has a label with id "lbl1" is it possible to access lbl1 from form2, change its text permenantly? thanks.   refer: http://dotnetslackers.com/Community/blogs/haissam/archive/2007/11/26/ways-to-pass-data-between-webforms.aspxSSNPlease remember to click "Mark as Answer" on the post that helps you. MinaSamy: hi all I have this scenarios i have two web forms, one called form1 and the other called form2 form1 has a label with id "lbl1" is it p...

how to call controls of web control form in coding of other forms?
hello everyone i have one problem i have created one webcontrol shoppingcart in which there are two labels one of qty and other of amt which are initially enable =falsenow on other page(aspx page) i have one txtbox of qty as txtqty i want tat as soon as user enters qty txtqty and clicks on add cart button it shd be display d value in lblqty of web control shopping cart make sure i m using datalist on aspx page so give me suggestions on tat basis and my coding is in vb. plz give ur suggestions as fast as possible. Neeti what do you mean by webcontrol.... it this user control or normal ...

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

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

Is there any web form control that can work as IFRAME html control?????
in html pages, we can use iframe control in which we can load another pages and/or folder explorer. now, i'm developing a web page in which i like to show the folder explorer when user clicks a link. as a prototype, i developed an html page like below: <html> <head><title>Using iFrame to browse a folder</title> </head> <body bgcolor=cyan> <table left=5px top=5px id=tabMain width=90% height=90% border=1 cellspacing=1 cellpadding=1> <tr height=100%> <td width=20% align=center valign=middle> <INPUT TYPE="Butto...

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 do you expose an event from a server control within an user control on an web form?
I have a calendar inside of an user control Simple.ascx The user control is sitting on my web form Simple.aspx. How do I access the VisibleMonthChanged event from my web form Simple.aspx? Is it possible? Yes Create Event in usercontrol which fires on page when VisibleMonthChanged event fires on usercontrol. Jigar Desai-----------------------Do not forget to "Mark as Answer" on the post that helped you. Ok, I created the event Public Event MonthChanged() in Simple.ascx.vb. Then I add the follow to Simple.aspx.vb Private Sub Simple_MonthChanged() Si...

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

Web Form vs. Web Content Form
If you don't mind, I would like to know what is the difference between those two items, when I go to add a new item I see both of those and I don't know what the difference is.  A content form is for use with a masterpage. A web form is a standalone web page. If you select web content form, you will then have to specify a masterpage for it. and what is a master page used for?  Hi, a master page is used to give a constant look and theme to a site, without having to duplicate code. So basically you can put your header, menu, nav and footer on a master page. Then a...

Mobile Web Controls vs. Web Controls
I am using VS2003 and I have realized that Mobile Web Controls are very basic and simple. So I saw in a post the way to use Web Controls inside Mobile Web Forms. Since then, I often use Web Controls instead of Mobile Web Controls. I put the Web Control inside a Mobile DeviceSpecific and put this DeviceSpecific inside a Mobile Panel. Why the Mobile Controls are so simple?  Does it happen the same in VS2005 or 2008? And, is it right to use only Web Controls inside Mobile Web Forms? Thanks. xesteban:Why the Mobile Controls are so simple?   They are simple because they suppor...

Html controls vs. Web controls
Can someone give me some examples if when it is best to use html controls over web controls and vice versa? Thanks, tdnxxx444 Web controls show up as <asp:class runat=server> (the "asp" may be replaced by other prefixes). They may have a corresponding HTML tag that they represent, but generally they are there to build all the HTML necessary for an idea. For example, something simple like the CheckBox web control still outputs several tags when you View Source: <span><input type=checkbox><label for>. Something like the Calendar control generates an en...

Web control in web control
Hi,There are two simple web user controls A and B, where B contains A. They just display the bunch of text boxes, so I do not need them even in tool pane. They sit in the same project next to web form.I noticed that web user control put on ASPX page does not appear in code behind, but if I create it with protected keyword and name being exactly the same as id it works fine. I can access such a web control from code behind and see the value assigned in IE. The problem is that the same routine does work for my A web control in B. When I assign the value IE, I keep getting null reference. ...

HTML Controls vs Web Controls
Is there a cut and dry or "best practice" answer for when to use straight HTML, the HTML controls (runat=server), or the web controls? Thanks! You could have a look here: ASP.NET Server Controls Recommendations and here, perhaps: Introduction to ASP.NET Server Controls-- Mike PopeASP.NET User EducationThis posting is provided "AS IS" with no warranties, and confers no rights. Thanks!!!...

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 and Web User Control
Hello, I have a Web User Control (ascx) that includes a button. This button has an onclick event method. This Web User control is included into a Web Form. (thru LoadControl). However, when I click on the button, the event method is not executed. What should I include in order it works fine? Thanks in advance. GAA. Using Loadcontrol is using dynamic controls and when using dynamic controls you must recreate the same dynamic controls ono postback to econstruct the page control tree. It is best if you do this during the Page PreInit event. How complex are your controls ...

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

How to access individual controls from a form containing the web user control containing those controls
 Below is a block of code in my .aspx form named default.aspx. In this form I load a web user control. I then add it to a place holder control.(Lines 3 and 4 below) So how do I access the individual controls in my web user control? I want to set the properties on those controls, but I am baffled as to how to access the control. For example I have a text label control named "label3". How do I access this control. Because for example, under certain situations I want to hide that control. ( Label3.Visible = false;)  1    if(!Page.IsPostBack) 2&nb...

Desktop Web Controls vs. Mobile Web Controls
Hi, after having a look at the posts in this forum about mobile issues, i still have some doubts. Hope someone can clarify this to me:VS2005 does not need MMIT (currently known as ASP .NET Mobile Controls) because it´s already included in 2.0 version, right?In VS2005, if i decide to build a web site to be accessible via a desktop browser or a mobile device, the right thing to do is use the asp .net web application template? In this case, the rendering is automatic depending on the device, correct?If i decide to create a web page to be accessible via a device browser, then, for now, i still h...

Server Web User Control or Web Custom Control
Ok, I made a DataGrid I like, stuck it in a Web Control Lib, and then to my toolbar. Now I want to take my nice little control and add it to a greater control, maybe place some buttons around it etc. I could always inherit from it in a new custom control and dynamically add the buttons, but I thought about using a Web User Control. I thought I could easily create a Web User Control, drop on my grid and the buttons on a form, and expose some properties and events, but once I got into it, I got a feeling that this isn't what a Web User Control is for. When designing a control li...

Web form designer in VS 2003 .Net does not know about base class controls
I have a base class derived from System.Web.UI.Page, and derived classes derived from the base class. The base class has protected HTML hidden fields in it, and the derived class's aspx page has these hidden fields specified. So far everything is OK.However if I open the derived class's aspx page in the Web Form designer, it immediately puts an asterisk on the tab, meaning some change needs saving without my having done anything. If I then close the aspx page and agree to save the changes, it adds the HTML hidden fields to my derived class, not only overlaying the base class's hidden fields ...

Web resources about - Web Form Server Controls Vs. HTML controls - 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 ...

WA fires: Harvey bushfire threatening Brunswick contained and under control
A bushfire that threatened parts of Brunswick has been further downgraded to "advice" as the threat to lives and homes receded.

Inside the wild—and wildly successful—early years of mission control
Mission Control, on the third day of Apollo 8. Seen on the TV monitor is a picture of Earth telecast from the spacecraft 176,000 miles away. ...

Through Google Glass — Mission Control at boj World Headquarters on a snowy Monday morning
YouTube caption: "CEO Gray Cat considers our larger strategy going forward while I do all the little stuff. Works out well for us."

Eagles of Death Metal playing Paris tonight; Jesse Hughes speaks out against gun control
Eagles of Death Metal are returning to Paris tonight (2/16) to "complete" their show at Le Bataclan that was a site of the Paris terror attacks. ...

Kids Today Can Whip Around In Mini Electric Cars While Their Parents Control The Action From An App
... my eye as a girl whipped it around a mini track at the convention center, a big ol’ grin on her face. My 8 y.o self is jealous: Parents control ...

It’s Time For Some Common-Sense Phone Control
Our children are in danger. Our children. Allison Yang, WPIX: The NYPD is urging people not to leave their cellphones near their beds because ...

How Tennessee’s Head Trainer Took Control Of The Allegations Against Peyton Manning
After Jamie Naughright said she was sexually harassed by Peyton Manning, the first person she called at the University of Tennessee was head ...

One weird trick is cruise control to shorter XCOM 2 load times
XCOM 2 is pretty hitchy and janky, though I've not encountered any game-breaking issues. Still, worse than the lazy virtual camera man too busy ...

Free The Skies: Privatizing Air Traffic Control
... Transportation Committee Chairman Bill Shuster used this opportunity to introduce a bill that would reorganize America’s air traffic control ...

Resources last updated: 2/17/2016 11:42:55 PM