Go to GoReading for breaking news, videos, and the latest top stories in world news, business, politics, health and pop culture.

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

106 3
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.
Source...

Leave A Reply

Your email address will not be published.