ASP .NET confusion - server controls

Posted by Brandi on Stack Overflow See other posts from Stack Overflow or by Brandi
Published on 2010-04-12T22:32:57Z Indexed on 2010/04/13 14:33 UTC
Read the original article Hit count: 288

I have read through the information in this question: http://stackoverflow.com/questions/22084/asp-net-aspxxx-controls-versus-standard-html but am still rather confused.

The situation was I was asked to do a web project where I made a wizard. When I was done with the project everyone asked why I had used an <asp:Wizard...>. I thought this was what was being asked for, but apparently not, so after this I was led to believe that server controls were just prototyping tools.

However, the next project I did my DB queries through C# code-behind and loaded the results via html. I was then asked why I had not used a gridview and a dataset.

Does anyone have a list of pros and cons why they would choose to use specific html controls over specific server controls and why? I guess I'm looking for a list... what server controls are okay to use and why?

EDIT: I guess this question is open ended, so I'll clarify a few more specific questions...

  1. Is it okay to use very simple controls such as asp:Label or do these just end up wasting space? It seems like it would be difficult to access html in the code behind otherwise.

  2. Are there a few controls that should just never be used?

  3. Does anyone have a good resource that will show me pros and cons of each control?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about servercontrols