ASP Net Table Tutorial
ASP Net Table Tutorial
Much of the code you write in ASP.NET will be executed on the Web server and will return
only HTML to the client. Fortunately, .NET provides you with many new controls that are
similar to standard HTML controls, such as drop-down lists and text boxes. Table A lists the
most common server controls.
Table A
Popular server controls
Control Function
<asp:Button id="button1" Text="Press" runat="server" Creates a standard button on
OnClick="submit"/> the page
<asp:Calendar runat="server" /> Creates a calendar
<asp:DropList id="list1" runat="server"> Creates a drop-down list
<asp:ListBox id="listbox" rows="4" runat="server"> Creates a basic list box
<asp:TextBox id="txtbox" runat="server" /> Creates a standard text box
.NET server controls have the advantage of being created on the Web server as opposed to
being created within the page like HTML. As a result, they're available for processing before
being sent to the client. For example, you can validate content within the page or on the
server side. That means you can validate content within the page and then revalidate content
on the server side.
For the most part, you can create a .NET control simply by adding this component:
runat="server"
Some development tools are even easier to use. For instance, Visual Studio .NET lets you
create a server control by dragging and dropping the control on a Web page.
In addition to the standard server-side HTML controls, ASP.NET offers a set of validation
controls: