473,566 Members | 3,307 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,datagri d)

any suggestion wil be appreciated..

Cheers,
siaj
Nov 19 '05 #1
5 6526
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**@discussio ns.microsoft.co m> wrote in message
news:FC******** *************** ***********@mic rosoft.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,datagri d)

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,datagri d)

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.co m> wrote in message
news:%2******** ********@TK2MSF TNGP12.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,datagri d)

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**@discussio ns.microsoft.co m> wrote in message
news:FC******** *************** ***********@mic rosoft.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,datagri d)

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
9604
by: Hari | last post by:
What is the difference between HTML controls, HTML server controls , ASP.Net controls? Which will give more performance?
2
9894
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. What is the difference between a Placeholder and a Div, other than a Placeholder does not render at runtime? Thanks.
4
2825
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
2040
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 controls. Obviously there are web controls that don't have any relation to HTML controls (like the calendar), but the basic web controls that produce...
4
2434
by: SAI | last post by:
Both have "TextBox" element and "Runat server". I don't understand the difference. Please advise. Thanks.
1
2680
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
17365
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, and I would like to know what it is so that I can take advantage of it in my code. Thanks. -- Nathan Sokalski njsokalski@hotmail.com...
12
3232
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" runat="server"> </asp:TextBox>
5
2070
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 controls. so what is exact difference between these two. any help will be truely appreciated.
0
7584
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8109
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7953
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6263
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.