Unit 3 - Introduction to ASP. Net
Unit 3 - Introduction to ASP. Net
3.0 Objectives
3.1 Introduction
3.2 Features of ASP.net 2.0
3.3 Stages in Web Forms Processing
3.4 Introduction to Server Controls
3.5 HTML Controls
3.6 Validation Controls
3.7 User Control
3.8 Data Binding Controls
3.9 Configuration
3.10 Personalization
3.10.1 User profiles
3.10.2 Personalization Providers
3.10.3 Using personalization
3.10.4 Defining profiles in Web .Config
3.10.5 User Profile information
3.10.6 Saving Profile Changes
3.10.7 Profiles and Users
3.11 Session State
3.12 Summary
3.13 Check your Progress - Answers
3.14 Questions for Self – Study
3. 15 Suggested Readings
3.0 OBJECTIVES
After studying this Chapter You will be able to –
explain the features of ASP.NET 2.0
discuss how Web Forms pages work in Web applications
discuss the HTML server controls with validation.
state Data Binding control in .NET
describe configuration and personalization?
3.1 INTRODUCTION
ASP.NET is a server-side Web application framework designed for Web
development to produce dynamic Web pages. It was developed by Microsoft to allow
programmers to build dynamic web sites, web applications and web services.
ASP.NET is the latest version of Microsoft's Active Server Pages technology
(ASP).
It is the next generation ASP, but it's not an upgraded version of ASP.
ASP.NET is an entirely new technology for server-side scripting. It was written from the
Introduction to ASP .NET 2.0 / 27
ground up and is not backward compatible with classic ASP. ASP.NET is the major
part of the Microsoft's .NET Framework.
Before you continue you should have a basic understanding of the following:
WWW, HTML, XML and the basics of building Web pages scripting languages like
JavaScript or VBScript the basics of server side scripting like ASP or PHP
What is ASP.NET?
ASP.NET is a server side scripting technology that enables scripts (embedded in web
pages) to be executed by an Internet server.
Microsoft Technology
ASP.NET is a program that runs inside IIS
IIS (Internet Information Services) is Microsoft's Internet server
IIS comes as a free component with Windows servers
IIS is also a part of Windows 2000 and XP Professional
ASP .NET / 28
Full support for XML standards like, XHTML, XML, and WSDL
Improved compilation and deployment (installation)
Improved site management
New and improved development tools
1) Master Pages : ASP.NET didn't have a method for applying a consistent look
and feel for a whole web site. Master pages in ASP.NET 2.0 solve this problem.
A master page is a template for other pages, with shared layout and
functionality. The master page defines placeholders for content pages. The
result page is a combination (merge) of the master page and the content page.
2) Themes : Themes are another feature of ASP.NET 2.0. Themes, or skins, allow
developers to create a customized look for web applications.
3) Web Parts : ASP.NET 2.0 Web Parts can provide a consistent look for a site,
while still allowing user customization of style and content.
New controls:
Zone controls - areas on a page where the content is consistent
Web part controls - content areas for each zone
Site Maps
Dynamic HTML menus
Tree Views
8) Data Access: Many web sites are data driven, using databases or XML files as
data sources. With ASP.NET this involved code, and often the same code had to
be used over and over in different web pages. A key goal of ASP.NET 2.0 was to
ease the use of data sources. ASP.NET 2.0 has new data controls, removing
much of the need for programming and in-depth knowledge of data connections.
9) Mobility Support: The problem with Mobile devices is screen size and display
capabilities. In ASP.NET, the Microsoft Mobile Internet Toolkit (MMIT) provided
this support. In ASP.NET 2.0, MMIT is no longer needed because mobile
support is built into all controls.
10) Images: ASP.NET 2.0 has new controls for handling images:
These controls are important for better image display on mobile devices, like hand-
held computers and cell phones.
11) Automatic Compilation: ASP.NET 2.0 provides automatic compilation. All files
within a directory will be compiled on the first run, including support for WSDL,
and XSD files.
13) Site Management: ASP.NET 2.0 has three new features for web site
configuration and management:
New local management console
New programmable management functions (API)
New web-based management tool
14) Development Tools: With ASP.NET Visual Studio.NET was released with
project and design features targeted at corporate developers. With ASP.NET
2.0, Visual Studio 2005 was released. Key design features for Visual Studio
2005 include:
Support for the features described above
Upload files from anywhere (FTP, File System, Front Page....)
No project files, allowing code to be manipulated outside Visual Studio
Integrated Web Site Administration Tool
No "build" step - ability to compile on first run
Visual Web Developer is a new free ASP.NET 2.0 tool for non-corporate developers
who don't have access to Visual Studio.NET.
ASP .NET / 30
Check your progress 3.2
Answer the following questions in 1-2 sentences.
a) What is ASP.NET?
…………………………………………………………………………………………..…
…………………………………………………………………………………………..…
b) Write any two ASP.NET features.
…………………………………………………………………………………………..…
…………………………………………………………………………………………..…
ASP.NET saves page and control properties between round trips. This is
referred to as saving the view state of the control.
It provides state management facilities so that you can save your own variable
and application-specific or session-specific information between round trips.
It can detect when a form is requested for the first time versus when the form
is posted, and allows you to program accordingly. You may want a different
behavior during a page postback versus an initial request.
ASP .NET / 32
3.4 INTRODUCTION TO SERVER CONTROLS
For creating Web Forms pages, you can use these types of controls:
HTML server controls HTML elements exposed to the server so you can
program them. HTML server controls expose an object model that maps very
closely to the HTML elements that they render.
Web server controls with more built-in features than HTML server controls. Web
server controls include not only form-type controls such as buttons and text boxes,
but also special-purpose controls such as a calendar. Web server controls are
more abstract than HTML server controls in that their object model does not
necessarily reflect HTML syntax.
Validation controls that incorporate logic to allow you to test a user's input. You
attach a validation control to an input control to test what the user enters for that
input control. Validation controls are provided to allow you to check for a required
field, to test against a specific value or pattern of characters, to verify that a value
lies within a range, and so on.
User controls that you create as Web Forms pages. You can embed Web
Forms user controls in other Web Forms pages, which is an easy way to create
menus, toolbars, and other reusable elements.
Every server control has a tag with the runat="server" attribute and is
converted to client-specific XHTML. ASP.NET server controls are objects and have
their own properties, methods and event handlers. Interesting to know is that server
controls can keep their state (value and design) stored between subsequent page
requests thanks to StateView.
Every control is derived from the Control class and inherits the properties and the
methods of this Control class. The most useful inherited properties are:
Controls: gives a collection with all the child controls for a specified server
control
EnableViewState: Boolean to decide whether the control has to track his
current state or not
ID: id of the server control, maybe the most important property
Visible: Boolean to decide if the control will be rendered
The most useful inherited methods are:
DataBind(): binds the control with a certain data source (e.g. resultset of an sql
query)
FindControl(): searches a child control with the given name (string)
HasControls(): Booleans that defines if this server control owns child controls
1) Page in ASP.NET
It might sound strange but the whole page is a control itself and acts as
container for everything that is placed in it. Some of the properties are: Title,
Session, Cache, Trace, Special on the Page control are the directives (start with
a @). In the Page directive you find what language is used for the code behind,
the path to the source file and the name of the class in the code behind and
possible extra properties for the page document.
2) Label Control
The Label control displays text in a set location on the page. Unlike static text,
the Text property of a label can be changed programmatically. Layout of the
text can be done programmatically by changing properties or with HTML tags
(which are allowed) in the text itself.
3) TextBox Control
The TextBox control enables the user to enter text. You have the possibility to
use the textbox as a single line, multiline or password field by changing the
TextMode property. The display width of a textbox is determined by its
Columns property and the height of a textbox is determined by the Rows
property (only for MultiLine textmode). You can limit the number of signs the
user can enter for a textbox with its textmode set to SingleLine or Password by
entering a value for MaxLength.
4) Button Control
The Button control is used to submit the form back to the server (postback). This
happens automatically in opposite to other controls where you have to enable
the AutoPostBack property to have the same effect. Buttons have a Causes
Validation property to trigger validation of all validation controls assigned to the
same group.
It is possible to use several buttons in a container control like a DataGrid or a
GridView. All these buttons have the same ID and it will be impossible to bind an
event handler to each button control's OnClick event (or other event) to
determine the particular button that was clicked. That's why buttons have a
CommandName and CommandArgument property to determine which
button you clicked and deliver the correct arguments to the event handler.
There are three types of buttons: the standard button, the ImageButton
(image acting as a button) and the LinkButton (link acting as a button). Notice
that the ImageButton doesn't have a Text property, but instead it does have an
AlternateText property which shows the entered text if the browser doesn't
support images.
ASP .NET / 34
5) DropDownList Control
The DropDownList control provides a single-select dropdown list. Each list item
has a value and an index. You can add items to the list one by one yourself or
by data binding a static array or another data source (e.g. results from a sql
query). To bind a data source you'll be using the DataTextField property to
link the text content and the DataValueField property to link the value of each
list item.
There are several ways to add items to the list at Design time. In design view
you can use the smart tag 'Edit items' which shows on the dropdown list or you
can click on the "..." next to the property Items. Both give the same window in
which you can add the items one by one. Or you can write the code for each list
item in the source view.
8) Panel Control
The panel control is mainly used as a container for other controls. It's useful to
group, hide or generate controls programmatically. If you generate controls
programmatically you'll have to recreate them every time you load the page
since the ViewState only remembers the state and not the controls you
generated. If you only want to generate controls you can replace the panel by a
PlaceHolder.
3.5 HTML CONTROLS
HTML elements in ASP.NET files are, by default, treated as text. To make
these elements programmable, add a runat ="server" attribute to the HTML element.
This attribute indicates that the element should be treated as a server control.
Note: ASP.NET requires that all HTML elements must be properly closed and properly
nested.
ASP .NET / 36
1) Example of HTMLButton
<script runat="server">
Sub button1(Source As Object, e As EventArgs)
p1.InnerHtml="You clicked the blue button!"
Sub button2(Source As Object, e As EventArgs)
p1.InnerHtml="You clicked the pink button!"
End Sub
</script>
<html>
<body>
<form runat="server">
<button id="b1" OnServerClick="button1"
style="background-color:#e6e6fa;
height=25;width:100" runat="server">
Blue button!
</button>
<button id="b2"
OnServerClick="button2"
style="background-color:#fff0f5;
height=25;width:100" runat="server">
Pink button!
</button>
<p id="p1" runat="server" />
</form>
</body>
</html>
Output Result
2) Example of HTMLForm
<script language = “vb” runat= "server">
if name.value<>"" then
p1.InnerHtml="Welcome " & name.value & "!"
end if
End Sub
</script>
<html>
<body>
<form runat="server">
Enter your name: <input id="name" type="text" size="30" runat="server" />
<br /><br />
<input type="submit" value="Submit" OnServerClick="submit" runat="server" />
<p id="p1" runat="server" />
</form>
</body>
</html>
3) Example of HtmlInputCheckBox
<script language = “vb” runat="server">
if red.Checked=True then
p1.InnerHtml="You prefer red!"
else
p1.InnerHtml="You prefer blue!"
end if
red.checked=false
blue.checked=false
End Sub
</script>
<html>
<body>
<form runat="server">
What color do you prefer?
<br />
<input id="red" type="checkbox" runat="server" /> Red
<br />
<input id="blue" type="checkbox" runat="server" /> Blue
<br />
<input type="button" value="Submit" OnServerClick="submit" runat="server"/>
<p id="p1" runat="server" />
</form>
</body>
</html>
Output Result
ASP .NET / 38
If Validation is true
Compare two
data is saved
values
Validate
<form runat="server">
<table border="0" bgcolor="#b0c4de">
<tr valign="top">
<td colspan="4"><h4>Compare two values</h4></td>
</tr>
<tr valign="top">
<td><asp:TextBox id="txt1" runat="server" /></td>
<td> = </td>
<td><asp:TextBox id="txt2" runat="server" /></td>
<td><asp:Button Text="Validate" runat="server" /></td>
</tr>
</table>
<br />
<asp:CompareValidator
id="compval"
Display="dynamic"
ControlToValidate="txt1"
ControlToCompare="txt2"
ForeColor="red"
BackColor="yellow"
Type="String"
Introduction to ASP .NET 2.0 / 39
EnableClientScript="false"
Text="Validation Failed!"
runat="server" />
</form>
</body>
</html>
Output Result :
<form runat="server">
Enter a date between 2005-01-01 and 2005-12-31:
<br />
<asp:TextBox id="tbox1" runat="server" />
<br /><br />
<asp:Button Text="Submit" runat="server" />
<br /><br />
<asp:RangeValidator
ControlToValidate="tbox1"
MinimumValue="2005-01-01"
MaximumValue="2005-12-31"
Type="Date"
EnableClientScript="false"
Text="The date must be between 2005-01-01 and 2005-12-31!"
runat="server" />
</form>
</body>
</html>
Output Result :
ASP .NET / 40
Writing Your First User Control
Actually, writing a basic user control (also sometimes called pagelets) couldn't
be much easier... most any ASP.NET page can be used as a server control. Here's a
simple example:
basic.ascx
<p>
This is a user control... really!
</p>
<html>
<head>
<title>ASP.NET User Control Sample - Basic</title>
</head>
<body bgcolor="#FFFFFF">
<asp101samps:SomeText runat="server" />
</body>
</html>
The above page will output a standard HTML page with the text contained in
our user control in place of the user control's tag. How does it do it? The magic here is
in the Register directive. To use it you'll need to specify three attributes:
TagPrefix : The TagPrefix attribute defines a namespace in which the control
will live. You can think of this as the world in which the control will live. Because of this,
you can have different controls with the same name and as long as they have a
different TagPrefix (and as a result different namespaces) they can peacefully co-exist
on the same page.
TagName : The TagName attribute determines the name by which the control
will be refered to. It needs to be unique within the namespace, but you can choose
whatever you like. Generally names are chosen that are indicative of what the control
actually does.
Src : The Src (or source) attribute simply specifies where the code that makes
up the control being defined is to be found. Virtual paths are used so the value should
be something like "control.ascx" or "/path/control.ascx" and not a physical path like
"C:\path\control.ascx."
Once you've added the Register directive, the control is registered and can be
used just like any other server control. You specify the TagPrefix and TagName in the
control's tag just like you would with a built in control and make sure you've got the
runat="server" attribute and you're ready to roll. Here's the basic form for a user
control's tag:
<TagPrefix:TagName runat="server" />
properties.ascx
<p>
<font color="<%= Color %>">
<%= Text %>
</font>
</p>
By default the control will look the same as before, but now we can modify the
color or text it emits either by setting properties in the control's tag or programmatically
from our code (as long as we give the control an id attribute by which to reference it).
Also note that I'm able to reuse the same control a number of times in the page and
set the properties of each instance independently.
properties.aspx
<html>
<head>
<title>ASP.NET User Control Sample - Properties</title>
</head>
<body bgcolor="#FFFFFF">
</body>
</html>
events.ascx
If Page.IsPostBack Then
If txtName.Text = strInitialText
ASP .NET / 42
txtName.Text = ""
End If
Else
txtName.Text = strInitialText
End If
End Sub
<asp:RequiredFieldValidator ControlToValidate="txtName"
id="valtxtName" Display="Dynamic" runat=server>
Please Enter a Name!
</asp:RequiredFieldValidator>
events.aspx
<html>
<head>
<title>ASP.NET User Control Sample - Validation & Events</title>
</head>
<body bgcolor="#FFFFFF">
<form runat="server">
<br />
</form>
</body>
</html>
The following controls are list controls which support data binding:
asp:RadioButtonList
asp:CheckBoxList
asp:DropDownList
asp:Listbox
The selectable items in each of the above controls are usually defined by one
or more asp:ListItem controls, like this:
<html>
<body>
<form runat="server">
<asp:RadioButtonList id="countrylist" runat="server">
<asp:ListItem value="N" text="Norway" />
<asp:ListItem value="S" text="Sweden" />
<asp:ListItem value="F" text="France" />
<asp:ListItem value="I" text="Italy" />
</asp:RadioButtonList>
</form>
</body>
</html>
However, with data binding we may use a separate source, like a database,
an XML file, or a script to fill the list with selectable items. By using an imported
source, the data is separated from the HTML, and any changes to the items are made
in the separate data source.
Example of ArrayList RadioButtonList
ASP .NET / 44
<script language = “VB” runat="server">
Sub Page_Load (S as object, e As Event Args)
if Not Page.IsPostBack then
dim mycountries=New ArrayList
mycountries.Add("Norway")
mycountries.Add("Sweden")
mycountries.Add("France")
mycountries.Add("Italy")
mycountries.TrimToSize()
mycountries.Sort()
rb.DataSource=mycountries
rb.DataBind()
end if
end sub
<html>
<body>
<form runat="server">
<asp:RadioButtonList id="rb" runat="server"
AutoPostBack="True" onSelectedIndexChanged="displayMessage" />
<p><asp:label id="lbl1" runat="server" /></p>
</form>
</body>
</html>
Output Result :
3.9 CONFIGURATION
The ASP.NET configuration system features an extensible infrastructure that
enables you to define configuration settings at the time your ASP.NET applications are
first deployed so that you can add or revise configuration settings at any time with
minimal impact on operational Web applications and servers.
ASP .NET / 46
Profile schema is defined within Web.Config as name/type pairs. Imagine that
in the course of designing your site, you decided you'd like to track the following
information about a particular user:
User name
Gender
Visit count
Birthday
Defining these properties is a matter of populating them in Web.Config. A
definition for the properties listed above might look like this Web.Config:
<system.web>
<profile automaticSaveEnabled="true" >
<properties>
<add name="NumVisits" type="System.Int32"/>
<add name="UserName" type="System.String"/>
<add name="Gender" type="bool">
<add name="Birthday" type="System.DateTime">
</properties>
</profile>
</system.web>
The personalization properties consist of name/type pairs and will basically
become the schema under which the personalization data will be stored. Once defined
in the Web.Config file, the profile may be used in the site through the Profile property
found in the current HttpContext (and is also available via the Page).
3.10.5 Use Profile Information
To use the profile in the Web site, you access it in much the same way you
might access session state. However, instead of being represented by name/value
pairs accessed through an indexer, the ASP.NET compiler will synthesize a profile
object based upon the scheme defined in the Web.Config file.
For example, given the schema listed above, ASP.NET will synthesize a class
named ProfileCommon, based upon the ProfileBase class. The synthesized class will
reflect the instructions written into the Web.Config by inserting properties, shown here
in bold:
public class ProfileCommon : ProfileBase
{
public virtual HttpProfile GetProfile(string username);
public object GetPropertyValue(string propertyName);
public void SetPropertyValue(string propertyName,
object propertyValue);
public HttpProfileGroupBase GetProfileGroup(String groupName);
public void Initialize(String username,Boolean isAuthenticated);
public virtual void Save();
public void Initialize(SettingsContext context,
SettingsPropertyCollection properties,
SettingsProviderCollection providers);
public string UserName{get; set;};
public int NumVisits{get; set;};
public bool Gender(get; set; );
public DateTime Birthdate{get; set; };
}
To access the profile properties, simply use the Profile property within the
page. The Profile property is an instance of the Profile Common class synthesized by
ASP.NET. Just access the members of the Profile, like so:
protected void Page_Load(object sender, EventArgs e)
{
if (Profile.Name != null)
{
Introduction to ASP .NET 2.0 / 47
Response.Write("Hello " + Profile.Name);
Response.Write("Your birthday is " +
Profile.Birthdate);
}
}
Profile information is associated with the current user based upon the identity
of the user. By default, ASP.NET uses the User.Identity.Name within the current
HttpContext as the key to store data. By default, profiles are available only for
authenticated users.
ASP.NET supports anonymous profiles as well. Turn this on within
Web.Config. The default tracking mechanism for anonymous profiles is to use cookies.
However, as with tracking session state, you may tell ASP.NET to use a mangled
URL.
The following exercise illustrates using personalization profiles based on the
user's login ID.
Using Profiles
1. Create a new project. Name the project MakeItPersonal.
2. Add a Web.Config file to the project. Update Web.Config to include some
profile properties. The example here includes a user name, a Theme, and a
birth date. Be sure to turn anonymous Identification to true. The following
example shows that you may group and nest profile structures using the
<group> element.
<system.web>
<profile>
<properties >
<add name="Theme" type="System.String"/>
<add name="Name" type="String"/>
<add name="Birthdate"" type="System.DateTime"/>
<group name="Address">
<add name="StreetAddress"/>
<add name="City"/>
<add name="State"/>
<add name="ZipCode"/>
</group>
</properties>
</profile>
</system.web>
1. Borrow the Default and SeeingRed Themes from the MasterPagesSite project.
This will let the user pick the Theme.
2. Borrow the UseThemes.aspx and .cs files from the MasterPagesSite project.
3. Borrow the Banner.ascx file from the MasterPagesSite.
ASP .NET / 48
4. Now update the Default.aspx page. This will be where users type profile
information. Add text boxes for the name, address, city, state, and zip code.
Add a drop-down list box populated with Default and SeeingRed items. This
will be used for selecting the Theme. Also add a calendar control to pick the
birthdate.
5. Add a button the user may click to submit profile information. Add a handler to
input these values into the profile. Double-click on the button to add the
handler.
The input screen should look something like this:
6. Update Page_Load to display profile information (if it's there). Grab the profile
object and set each of the text boxes and the calendar control.
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
{
ProfileCommon pc = this.Profile.GetProfile(Profile.UserName);
if (pc != null)
{
this.TextBoxName.Text = pc.Name;
this.TextBoxAddress.Text = pc.Address.StreetAddress;
this.TextBoxCity.Text = pc.Address.City;
this.TextBoxState.Text = pc.Address.State;
this.TextBoxZipCode.Text = pc.Address.ZipCode;
this.DropDownList1.SelectedValue = pc.Theme;
this.Calendar1.SelectedDate = pc.Birthdate;
}
}
}
// …
}
ProfileCommon pc = this.Profile.GetProfile(Profile.UserName);
if (pc != null)
{
pc.Name = this.TextBoxName.Text;
pc.Address.StreetAddress = this.TextBoxAddress.Text;
pc.Address.City = this.TextBoxCity.Text;
pc.Address.State = this.TextBoxState.Text;
pc.Address.ZipCode = this.TextBoxZipCode.Text;
pc.Theme = this.DropDownList1.SelectedValue;
pc.Birthdate = this.Calendar1.SelectedDate;
pc.Save();
}
}
8. Finally, update the UseThemes.aspx page to use the Theme. Override the
page's OnPreInit method. Have the code apply the Theme as specified by the
profile.
9. When you surf to the page, you should be able to enter the profile information
and submit it. Following your initial visit, the profile will be available whenever
you hit the site.
ASP maintains session state by providing the client with a unique key
assigned to the user when the session begins. This key is stored in an HTTP cookie
that the client sends to the server on each request. The server can then read the key
from the cookie and re-inflate the server session state.
Config.web
There are two types of configuration files: a machine configuration file and an
application configuration file, both named config.web. The two are identical, except
that the machine configuration file applies settings to all applications but the
application configuration files are either restrictive or expansive on an application-by-
application basis.
The machine config.web file is in the WinNT\Microsoft.NET\Framework\v1.0.2204
directory, while the optional application configuration files exist in the application's
directory. Application config.web files are optional in the sense that if an application
config.web file doesn't exist, the machine config.web settings are used instead.
ASP.NET session state settings can be made in the machine config.web file and
overridden in a particular application's config.web file.
Session configuration
Below is a sample config.web file used to configure the session state settings for an
ASP.NET application:
<configuration>
<sessionstate
mode="inproc"
cookieless="false"
timeout="20"
sqlconnectionstring="data source=127.0.0.1;user id=<user
id>;password=<password>"
server="127.0.0.1"
port="42424"
/>
</configuration>
<form runat=server>
<input id=text1 type=text runat=server>
<input type=submit runat=server
OnServerClick="Session_Add" Value="Add to Session State">
<input type=submit runat=server
OnServerClick="CheckSession" Value="View Session State">
</form>
<hr size=1>
<font size=6><span id=span1 runat=server/></font>
This simple page wires up two server-side events for the Add and View buttons, and
simply sets the session state to the value in the text box.
3.12 SUMMARY
Web Forms Page Life Cycle for a Web Forms page is similar to that of any Web
process that runs on the server. Certain characteristics of Web
processing information is passed through HTTP protocol, the stateless nature of
Web pages, the ASP.NET page framework performs many Web application
services for us. It is important to understand the sequence of events that occur
when a Web Forms page is processed.
ASP.NET server controls are objects and have their own properties, methods
and event handlers. HTML elements in ASP.NET files are, by default, treated as
text. To make these elements programmable, add a runat ="server" attribute to
the HTML element. This attribute indicates that the element should be treated as
a server control.
The support ASP.NET provides for personalization service greatly simplifies the
whole management and storage of personal information. Defining a Web site's
personalization facilities begins with defining User Profiles.
A session is defined as the period of time that a unique user interacts with a
Web application. Session state is a collection of objects, tied to a session are
stored on a server.
ASP .NET / 54