You are here:About>Computing & Technology>Visual Basic> Learn VB.NET> Learn ASP.NET> Learn ASP.NET 2.0 - ASP.NET 2.0 Server Controls
About.comVisual Basic
Newsletters & RSSEmail to a friendSubmit to Digg

Learn ASP.NET 2.0 - ASP.NET 2.0 Server Controls

From Dan Mabbutt,
Your Guide to Visual Basic.
FREE Newsletter. Sign Up Now!
Apr 13 2008

Part 4 of an About Visual Basic Tutorial

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:

<p>
   <input name="AVBSubject" type="text" id="AVBSubject" style="width:500px;" />
</p>

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
Postback, returning data back to the server for more processing, can also take place after this.
 All Topics | Email Article | | |
Advertising Info | News & Events | Work at About | SiteMap | Reprints | HelpOur Story | Be a Guide
User Agreement | Ethics Policy | Patent Info. | Privacy Policy©2008 About, Inc., A part of The New York Times Company. All rights reserved.