Question : Does ASP.NET Control Reduce Effeciency? - Is It Better to Use the HTML Tags? - ASP.NET

1. Is using alot of ASP.NET control tags make my website slower? I found myself using alot of Labels such as >, every time my page goes to the server, the server will have to go through all these ASP.NET tags. On the other hand, if i put the equivalent of , the server wouldn't have to go through many ASP.NET control tags which in turn makes the post back faster. I could be wrong, please advise.

2. How is it done practically in majority of companies? Do they prefer using HTML tags more than ASP.NET tags?

3. I'm not seeing any advantage of using ASP.NET controls when the control is not an interactive such as static texts, images, etc. Is there any down sides when using HTML tags instead ASP.NET controls?

Answer : Does ASP.NET Control Reduce Effeciency? - Is It Better to Use the HTML Tags? - ASP.NET

Well, the user of server controls makes your site slower. Those controls must be processed in the server and finally renders out in equivalent HTML tags. If you use directly HTML tags, that processing does not happens.

So, if you can, use HTML tags. When do you have to use server controls? Well, it's easy... when you need to access those controls on the server.

Imagine this scenario (it's a real scenario based on a real web application I'm working with): I have a web site that must be able to show in different languages by user selection. So I have many labels and other controls that, depending on the user language selection, must show different texts. The algorithms and processing that does the translation relies on the server. So I need server labels, because on each Page_Load I've got a code that recursively get all the server controls on the page and applies the translation based on session variable holding the user selected language. In these same pages, I show images that doesn't need translations because doesn't contain text. So for those images I dont use the Image server control, but I use the HTML tag.

Hope that helps.
Random Solutions  
 
programming4us programming4us