Overall, I would use the asp.net server controls most of the time. The
only time I would go against that rule is when I have controls that I am
using more on the client side and only collecting data from in a large
pull (the entire form). I would also be careful to pick forms that are
unlikely to become more complex and need a lot of handling on the server
side. WHile you can handle HTML controls (runat="server"), they are not as
rich.
The HTML controls were included, primarily, to allow an easy transition
from traditional ASP and other "legacy" technologies to ASP.NET. It is
very rare you will use the HTML controls.
If you need a lot of client side customization, through JavaScript, the
HTML controls are a bit easier to work with, but you can emit JavaScript
from the server side, so this is only marginally easier to do. And, is it
worth the sacrifice?
I would also consider HTML controls if your developers are not skilled in
web server controls, as they map to the HTML elements. But, you may
sacrifice some of the rich user interface heading this direction, so use
this reason with caution. Is the slightly lower learning curve worth the
sacrifice?
In ASP.NET 1.x, the story was a bit different, and I could see more
reasons to use the HTML controls. With 2.0, I will have to think hard to
come up with a really good reason.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
*********************************************
Think outside the box!
*********************************************
Eric Layman said:
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>
When should we use the normal input text box and when should we use the
asp textbox?
please advise.
Thanks.