473,386 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Difference in Web server Controls and HTML Server Controls

Hello All,
Can any one give me a clue when to use Web Server controls/ HTML server
controls/HTML Controls. As I understand ..
HTML controls should be used if u dont need to refer it in the code behind
a(simply bcaz it is not recognized in the code behind IDE) and it does not
make a server trip.
HTML server Controls should be preferred over Web Server controls as they
are light weight than ASP.NET web Server controls.(If they have same
performance why ever use HTML server controls??)
Web Server controls should be used only when that control is not there in
HTML server control...like calender control,datagrid)

any suggestion wil be appreciated..

Cheers,
siaj
Nov 19 '05 #1
5 6515
Siaj:
I'd say you are right about plain-jane HTML controls...they are useful when
you don't need them on the server.

The real question is when to user html server controls and web server
controls.

First, the most obvious answer is when you don't have a choice. For example
there's nothing like the repeater/datagrid/datalist/calendar/... in html
server controls so you don't really have a choice. Also, there's nothing
like an input type="file" for web server controls so you have to use the
html server control.

However, html server controls partly exist just to help developers migrate
to ASP.Net because all you need to do is add an id and a runat="server" and
you are up and running. If you are starting a project from scratch, I'd
always prefer web server controls because they provide greater flexibility.
I wouldn't let any performance differences (if there are any) be a factor
because I'd expect it to be extremely small if anything..

(gonna add this one to the FAQ I think)

Hope that helped,
Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"siaj" <si**@discussions.microsoft.com> wrote in message
news:FC**********************************@microsof t.com...
Hello All,
Can any one give me a clue when to use Web Server controls/ HTML server
controls/HTML Controls. As I understand ..
HTML controls should be used if u dont need to refer it in the code behind
a(simply bcaz it is not recognized in the code behind IDE) and it does not make a server trip.
HTML server Controls should be preferred over Web Server controls as they
are light weight than ASP.NET web Server controls.(If they have same
performance why ever use HTML server controls??)
Web Server controls should be used only when that control is not there in
HTML server control...like calender control,datagrid)

any suggestion wil be appreciated..

Cheers,
siaj

Nov 19 '05 #2
> HTML controls should be used if u dont need to refer it in the code behind
a(simply bcaz it is not recognized in the code behind IDE) and it does not make a server trip. Not true. You can always add runat=server to any html and it will be
recognized on server.
HTML server Controls should be preferred over Web Server controls as they
are light weight than ASP.NET web Server controls.(If they have same
performance why ever use HTML server controls??) Should be true. Not aware of any figures though.
Web Server controls should be used only when that control is not there in
HTML server control...like calender control,datagrid)

Not only. Web controls inherit from another class. They have different set
of members. You might prefer them just because you like their members. They
also more consistent between themselves.

Eliyahu
Nov 19 '05 #3
Another point to see - of course, you can club it under server-side
support:

Availability of numerous eventhandlers! That really a big plus.
--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
---------------------------

Nov 19 '05 #4
Has anyone done any testing with this? I am not sold on the fact that HTML
Controls that are marked with runat="server" is more efficient that using
the web server controls. All controls marked with this attribute is
compiled along with your page class and I don't see where performance would
come into play. I'm sure someone with more time on their hands than I , have
done some benchmark testing. :-)
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
HTML controls should be used if u dont need to refer it in the code
behind
a(simply bcaz it is not recognized in the code behind IDE) and it does

not
make a server trip.

Not true. You can always add runat=server to any html and it will be
recognized on server.
HTML server Controls should be preferred over Web Server controls as they
are light weight than ASP.NET web Server controls.(If they have same
performance why ever use HTML server controls??)

Should be true. Not aware of any figures though.
Web Server controls should be used only when that control is not there in
HTML server control...like calender control,datagrid)

Not only. Web controls inherit from another class. They have different set
of members. You might prefer them just because you like their members.
They
also more consistent between themselves.

Eliyahu

Nov 19 '05 #5
Thanks a lot...

"Steve C. Orr [MVP, MCSD]" wrote:
HTML controls are lighter weight, while web controls are more powerful.
Like everything in programming, it's a trade off.

Here are more details:
http://SteveOrr.net/faq/3in1.aspx#HTMLvsWeb

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"siaj" <si**@discussions.microsoft.com> wrote in message
news:FC**********************************@microsof t.com...
Hello All,
Can any one give me a clue when to use Web Server controls/ HTML server
controls/HTML Controls. As I understand ..
HTML controls should be used if u dont need to refer it in the code behind
a(simply bcaz it is not recognized in the code behind IDE) and it does
not
make a server trip.
HTML server Controls should be preferred over Web Server controls as they
are light weight than ASP.NET web Server controls.(If they have same
performance why ever use HTML server controls??)
Web Server controls should be used only when that control is not there in
HTML server control...like calender control,datagrid)

any suggestion wil be appreciated..

Cheers,
siaj


Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Hari | last post by:
What is the difference between HTML controls, HTML server controls , ASP.Net controls? Which will give more performance?
2
by: bdwise | last post by:
What is the difference between a Panel and a <div> tag with runat="server"? It seems that I can add child controls to either one in a code-behind and they both render to a <div> anyway at runtime....
4
by: Henri | last post by:
For instance, when should I use HtmlControls.HtmlImage, and when should I use WebControls.Image ? And what is the difference between <img runat="server" /> and <asp:image runat="server" /> ?
8
by: Alan Silver | last post by:
Hello, ASP.NET newbie here so please be nice ;-) I'm reading ASP.NET Unleashed, following a recommendation here. I am a little confused about the difference between HTML controls and web...
4
by: SAI | last post by:
Both have "TextBox" element and "Runat server". I don't understand the difference. Please advise. Thanks.
1
by: Beffmans | last post by:
Hi I work with .net 1.1 and i wanted to know the difference between a html table and a <asp:table>? Which one is better for a consistent layout of your asp.net pages? ch Beffmans
12
by: Nathan Sokalski | last post by:
What is the difference between the Page_Init and Page_Load events? When I was debugging my code, they both seemed to get triggered on every postback. I am assuming that there is some difference,...
12
by: Eric Layman | last post by:
Hi, What's the difference between a normal web element: <input type="text" id="txtname" name="txtname" runat="server"> vs webcontrol text box: <asp:Textbox id="username" Columns="10"...
5
by: archana | last post by:
Hi all, can anyone tell me difference between htmlcontrols and web controls. If i have table web control and table html controls which one should i use. Because i can add runat tag to html...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.