This is a free tutorial to help beginning programmers get up to speed building their own web pages using ASP.NET 2.0. In this tutorial, I concentrate on using free software tools from Microsoft including Visual Web Developer 2008 Express and SQL Server 2005 Express. To get the most from this tutorial, you might want to start at the beginning:
Part 1 - A "From the Ground Up" Tutorial - Programming for the networked world.
About Server Controls
An ASP.NET server control is a .NET class program that executes on the server but sends HTML content back to the browser for display.
We've seen a number of them already. Every server control has a few things in common. They're all 'declared' in the .aspx file with code that looks like this:
<asp:controlname id="ControlID" runat="Server"></asp:controlname>
For example, in the Lesson 3 AVBAsk website, this was the code used to declare a TextBox server control:
<asp:TextBox ID="AVBSubject" runat="server" Width="500px"></asp:TextBox>
When your browser requests the Default.aspx web page in the ASPAsk website from the server, the ASP.NET Framework code executes code in the TextBox class. This code creates the HTML that is actually sent to the browser. So the code the browser actually receives (for the TextBox server control) actually looks like this:
<input name="AVBSubject" type="text" id="AVBSubject" style="width:500px;" />
To recap ...
- A server control is declared as part of the HTML in a file that is on the server
- When the browser client requests the file, ASP.NET converts the control to standard HTML (this is called "rendering") and sends it to the client
- The browser client then displays the HTML