Professional Documents
Culture Documents
NET Framework
Gholamali Semsarzadeh
July 2001
Introduction to .NET
What Is .NET
.Net is a new framework for developing windows-based
and web-based applications within the Microsoft
environment.
The framework offers a new set of software
development tools that are superior to the old tools.
The framework offers a fundamental shift in Microsoft
strategy: it moves application development from clientcentric to server-centric.
Introduction to .NET
Agenda
Introduction to .NET
Introduction to .NET
Introduction to .NET
Introduction to .NET
Introduction to .NET
Examples of Types
Type
Declaration
Usage
(Properties)
Usage
(Methods)
Dim i As Integer
i=100
i+1
Dim r As Rectangle
r.Width*r.Height
r.Area
Dim c As Chart
c.BackColor=red
c.AddSeries (points)
R=SqlText
Dim c As Check
c.Cash
c.Amount=100
Introduction to .NET
Metadata
A type must be self descriptive: It must describe properties
and methods that it exposes.
Examples:
The type Integer describes what values it takes and what
operations it accepts.
The type Check describes what values (e.g., AccountNo
and Amount) it takes and what operations (e.g., Cash,
Deposit) it accepts.
Introduction to .NET
Assembly
To allow others to use a type, the developer must
package it in an assembly.
A component (delivered in an assembly) is the building
block for software construction.
Structurally an assembly consists of a manifest and one
or more modules. Each module consists of metadata
(in IDL) and one or more types (in IL).
Introduction to .NET
10
Manifest
The manifest identifies an assembly and declares its
contents.
It describes:
Identity of an assembly
Its security requirements
The identity of other assemblies it depends on
The types exposed by the assembly
Introduction to .NET
11
.NET
Class Library
Introduction to .NET
12
Introduction to .NET
13
VB.NET
The .NET version of Visual Basic is as powerful as C#
and is incompatible with its previous version VB 6.0.
It contains the following new features all of which are
enforced by CLR and are common with C#:
Common IDE (Interactive Development Environment)
Common type system
Common object orientation capabilities
Common language library
Common error and exception handling
Common form drawing tools
Common Web page design tools
July 22, 2001
Introduction to .NET
14
Introduction to .NET
15
Introduction to .NET
16
Introduction to .NET
17
Introduction to .NET
18
Introduction to .NET
19
Introduction to .NET
20
Introduction to .NET
21
Server-Side Controls
ASP and JSP provide a language to generate HTML markups. In
ASP.NET the complexity of this language is significantly reduced
by using server-side controls.
For each HTML control (such as a list box or an input text box)
there exists a server-side control in ASP.NET. When a Browser
requests a specific ASP.NET page in its URL the following events
happen:
The ASP.NET program is executed
Each server-side control in that program generates a
corresponding HTML control
As the final result, the ASP.NET program generates an HTML
page that is targeted to the version of the Browser that
requested the page.
July 22, 2001
Introduction to .NET
22
Example:Server-Side Controls
ASP.NET code for displaying a listbox:
<ASP:ListBox ID=List1 RUNAT=Server>
<ASP:ListItem>Jan</ASP:ListItem>
<ASP:ListItem>Feb</ASP:ListItem>
<ASP:ListItem>Mar</ASP:ListItem>
</ASP:ListBox>
Corresponding HTML code:
<SELECT Size=3>
<Option>Jan</Option>
<Option>Feb</Option>
<Option>Mar</Option>
</SELECT>
July 22, 2001
Introduction to .NET
23
Server-Side Processing
A server-side control can detect a user event (e.g., a
mouse click) and execute a server-side script that
contains the code (the event handler) to handle that
event.
The event is generated on the client-side but
handled on the server-side.
The event handler typically changes the properties
and calls the methods of various controls on the
ASP.NET page.
At the termination of the event handler a new HTML
page is posted back to the Browser.
Introduction to .NET
24
Introduction to .NET
25
ASP.NET Benefits
ASP.NET Uses .NET languages to generate HTML pages. HTML
page is targeted to the capabilities of the requesting Browser
ASP.NET Program is compiled into a .NET class and cached the
first time it is called. All subsequent calls use the cached version.
Introduction to .NET
26