I am bit confused about HTML controls and ASP.NET controls. Which one should I prefer the HTML Controls or ASP.NET Controls?
Loading
I am bit confused about HTML controls and ASP.NET controls. Which one should I prefer the HTML Controls or ASP.NET Controls?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
ajay rajuPosted May 3, 2010, 8:51 AM
Html controls are client-side controls and ASP.Net controls are server-side controls, and Every ASP.Net control contains one attribute i.e., runat = "server". means it tell us this is serverside control, runat server.
Basically most of conditions we are using only ASP.Net controls, we need some static page in our website that conditions to we use HTML controls for Reducing The Burden of Server.
example if in our website we have any images,animations,etc that conditions to we use HTML controls because no need to execute these images and animations, these we placing display purpose only.
I think you understand my answer.
Thanks.
Dipa AhujaPosted May 3, 2010, 3:21 AM
Abdur RahmanPosted May 3, 2010, 1:15 AM
ASP.Net Controls server side controls which includes all HTML Controls.
So, better use always ASP.Net Controls, until you feel that there is no need of interaction or server side behavior.
HTML Controls are light weight when you want to just display some messages or static content on the page.
Amit ChoudharyPosted May 3, 2010, 1:01 AM
you are right its a confusing issue some times.. which is preferred to use..
according to my point of view... if you want to perform some actions on server or you want to use your control with your server side logic then you should use Asp.net server control cause they are accessible to server side code behind
and your server controls are DataBind and produce dynamic HTML code.
you should use html control when you required no server side interaction attached to that control. Either your goal to use a control that is static or having only client side functionality using javascript.
Please mark "Do you like this post" if it helps you.