Você está na página 1de 2

Major Features of

ASP.NET Server Controls


When you develop an ASP.NET Web Form, you can use the following
type of controls:

• HTML Server Controls You can manipulate these controls at


the server-side. Before dispatching a form to the client, the ASP
Engine converts them to the equivalent HTML elements.These
controls are included in the System.Web.UI.HtmlControls
namespace.
• Web Server Controls (also known as Web Controls or
ASP.NET Web Form Controls) These are the new generation’s
controls developed by Microsoft.They have many useful built-in
features, and a standard set of properties. In the HTML or .aspx
file, these are typically referenced with an asp: prefix such as
asp:Label, asp:Button, or asp:TextBox. Besides the form-type
server controls such as labels, button, and dropdown, there are a
number of special-purpose controls like the Calendar and
AdRotator controls.The ASP Engine also maps these controls to
standard HTML equivalent controls before dispatching the page
to the client.These Web server controls is available in the
System.Web.UI.WebControls namespace.
• Validation Controls This set of controls provides Rapid
Application Development (RAD) features for automatically
checking the specified validity of user inputs.These controls are
available in the System.Web.UI.WebControls namespace.
• Custom Controls You can develop your own server controls by
extending an existing control or group of controls to provide
additional functionalities.There are two versions of custom
controls:Web User Controls and Web Custom Controls.The Web
User Controls are easy to develop, and are typically stored as
.ascx files.The Web Custom Controls require in-depth knowledge
of Object Oriented Programming and the Common Language
Runtime (CLR).These are stored in compiled form as assemblies.

In an IIS environment, the ASP and ASP.NET can run side by side. If you install
ASP.NET, your existing ASP applications will continue running. The IIS uses
the ASP Engine to process the .asp files, whereas it uses the ASP.NET Engine
to process the .aspx files. Session states and application states are not
shared between ASP and ASP.NET pages.

An HTTP message has two parts: the HTTP Header and the HTTP
Body.Thus, the browser can package the user-given data in the
Request object in one of two ways. It may augment the URL with the
name-value pairs of submitted data. Alternatively, it can package the
submitted data inside the body part of the Request message.Which of
the alternative methods will it use? The answer depends on the
specifications in the HTML form element.A typical form tag is shown in
Figure 3.1.The Method parameter is used to specify the mode of data
transmission. If it is “Get”, the browser sends the data in the header
section of the HTTP message. If it is “Post”, the data are sent in the
body section.The Action parameter can be used to request a specified
html or other documents like .asp or .aspx files.
Figure 3.1 Major Parameters (Attributes) of an HTML Form Element
<form name= "myForm" Action="Sample1.html" Method="Get">
Name of the Current Form Requested Page Send Data via URL

Server-Side Processing in ASP.NET


An ASP.NET file has an *.aspx extension.Typically, it contains HTML
elements, server-side codes and client-side codes. As shown in Figure
3.4, when a user requests an ASPX page, the server retrieves it from
the disk and then sends it to the ASPX Engine for further
processing.The ASPX Engine compiles the server side codes and
generates the page class file. It then instantiates the class file and
executes the instructions to develop the response object. During the
execution stage, the system follows the programmatic instructions (in
the server-side code) to process the data submitted by the user.
Finally, the server transmits the response object to the client. In short,
the major steps in processing a request for an ASPX page are as
follows:

1. The server receives a request for a desired ASPX page.


2. The server locates the page in the disk.
3. The server gives the page to the ASP.NET Engine.
4. The ASP.NET Engine compiles the page and generates the page
class. If the class had already been loaded, it simply provides a
thread to the running class instead of regenerating the class.
During compilation, it may require other code classes, such as
code-behind classes and component classes. These are
assembled during this step.
5. The ASP.NET instantiates the class, performs necessary
processing, and it generates the Response object.
6. The Web server then sends the Response object to the client.

Você também pode gostar