Sei sulla pagina 1di 55

Introduction to ASP.

NET

Presented by
Venkatesham Aithagoni.
What We Will Cover

 Introduction to Microsoft® .NET


 “Classic” ASP
 Microsoft® ASP.NET
 Server controls
 Data controls
 ASP.NET Web applications
 Business objects
 Web services
 Additional topics
So Why This Presentation?
 ASP.NET offers many enhancements over classic ASP but…
 With ASP.NET, there’s a lot new to learn
 Solves many ASP issues
 RAD for the Web
Demonstrations
 ASP vs. ASP.NET
 Server controls walk-through
 Validation
 Data controls
 Cookieless sessions
 Web services
 Page caching
Agenda

 Introduction to .NET
 “Classic” ASP
 ASP.NET
 Server controls
 Data controls
 ASP.NET Web applications
 Business objects
 Web services
 Additional topics
Introduction to .NET
1st Generation

Client Logic Servers


Data, Hosts

Biz Logic
Browsers
OS
Services
Web app developers took Applications largely operating
advantage of these local in a client / server model were
services and used HTML augmented with Web browser
to “project” the UI to many and servers. The industry
types of clients focused on rich OS and local
Microsoft provided COM, IIS, services provided by products
Internet Explorer like SQL Server™.
Introduction to .NET
2nd Generation

Biz Servers
Rich Tier Logic
Client Logic Data, Hosts

“Stateful”
Browsers OS
Services “Stateless” &
“Geo-Scalabl
COM+ Services improve reliability,
scalability and manageability. Internet Separation of data and
Explorer provides DHTML for better business logic provide
interactivity. greater scalability and
Combination of “stateless” Web performance while
protocols with DNS and IP routing have accessing enterprise
enabled mass-scale “geo-scalability” and legacy data.
Introduction to .NET
Web Services: The Next Generation

Applications Become
Other Programmable Web Services Public Web
Services X Services
ML M L
BizBiz
Logic X
& Web
Tier Logic Building Block
Smarter Service
Clients XML XML Services

Internal
Standard L XML Services
Browsers HTM OS
OS
Services
Services
L XM
Smarter XM L Servers
Devices Open Internet Data, Hosts
Communications Protocols
Richer, More
(HTTP, SMTP, XML, SOAP) Applications
Productive User Leverage
Experience Globally-
Introduction to .NET
The .Net Platform

Visual Your Application Your Internal


Studio®
® .
and Web Service Services
NET
Orchestratio
n .NET Enterprise
Servers

Operati
.NET
Applications

ons
Framewo
Using Your rk .NET
Service
Windows® ® Foundation
CE, 2000, XP, Services
.NET
End-User Internet Protocols rrdd
Clients SOAP “blue book”
3 Party Web Services
Service
HTTP, SMTP, XML
Introduction to .NET
The .NET Framework and Visual Studio .NET

Visual Basic® C++ C# JScript® …

Common Language Specification

Visual Studio .NET


ASP.NET: Web Services Windows
and Web Forms Forms

ADO.NET: Data and XML

Base Class Library

Common Language Runtime


Agenda

 Introduction to .NET
 ASP today
 ASP.NET
 Server controls
 Data controls
 ASP.NET Web applications
 Business objects
 Web services
 Additional topics
“Classic” ASP
Successes

 Simple procedural programming model


 Access to COM Objects
 ADO
 File system object
 No compiling, just save
 Support for multiple scripting languages
 Mix HTML and code
 VBscript – leverage Visual Basic skills
“Classic” ASP
Challenges

 Code readability
 Coding overhead
 PostBack complexity
 Reuse
 Performance
 DLL locking
 Deployment
 Sessions
 Caching
“Classic” ASP
Challenges

 Code readability
 Coding overhead
 PostBack complexity
 Reuse
 Performance
 DLL locking
 Deployment
 Sessions
 Caching
Agenda

 Introduction to .NET
 “Classic” ASP
 ASP.NET
 Server controls
 Data controls
 ASP.NET Web applications
 Business objects
 Web services
 Additional topics
ASP.NET
Architecture

ASPX

.ASPX
.ASPX
ASP.NET
Architecture

Compiled
Compiled .ASPX
.ASPX
ASP.NET
Architecture

Compiled
Compiled .ASPX
.ASPX
ASP.NET
Architecture

Compiled
Compiled .ASPX
.ASPX
ASP.NET
Execution Model

Source Visual Basic C# C++


code
Unmanaged
Compiler Compiler Compiler
Component

Managed Assembly Assembly Assembly


code IL Code IL Code IL Code

Common Language Runtime

JIT Compiler

Native Code

Operating System Services


ASP.NET
Features

 ASPX, ASP – side by side


 Simplified programming model
 Simplified deployment
 Better performance
 Caching
 Security
 Powerful controls
ASP.NET
Features

 Simplified browser support


 Simplified form validation
 Code behind pages
 More powerful data access
 Web services
 Better session management
ASP.NET
Features

 No DLL locking
 No DLL registration
 Simplified configuration
 Pagelets
Agenda

 Introduction to .NET
 “Classic” ASP
 ASP.NET
 Server controls
 Data controls
 ASP.NET Web applications
 Business objects
 Web services
 Additional topics
Server Controls
Simplify Common Tasks

 Simplify common tasks


 Forms
 Tables
 Data display
 Calendar
 Ad rotator
 Server-side programming model
 Automatic browser compatibility
 Less code, less complexity
 Extensible
Server Controls
Browser Support

 Targets client on the fly


<asp:textbox ForeColor=“red”/>
 Style
 Font

 Validation
 Client-side
 Server-side
Server Controls
Validation

 Without code
 Required field
 Within range
 Two fields equal (password)
 Regular expressions
 Validation error messages
 With code, but simplified
 Custom validation
Agenda

 Introduction to .NET
 “Classic” ASP
 ASP.NET
 Server controls
 Data controls
 ASP.NET Web applications
 Business objects
 Web services
 Additional topics
Data Controls

 Bind to many data sources


 Collections
 Array
 HashTable
 ADO.NET
 DataReader
 DataSet
 XML
Data Controls
ADO.NET

 Connection
 Command
 DataReader
 DataSet
 DataAdapter
 DataView
Data Controls
ADO.NET

DataSet
Database
Authors
Connection Authors
Authors

DataAdapter
Select … from Authors
Data Controls
ADO.NET

DataSet
Database
Authors
Connection Publishers
Publishers

DataAdapter
Publishers
Select … from
Publishers
Data Controls
ADO.NET

DataSet
Authors GridView

Repeater
Publishers
ListView

DataView
Agenda

 Introduction to .NET
 “Classic” ASP
 ASP.NET
 Server controls
 Data controls
 ASP.NET Web applications
 Business objects
 Web services
 Additional topics
ASP.NET Web Applications

 Global ASAX
 Application_Start
 Application_End
 Session_Start
 Session_End
 Session
 Application
ASP.NET Web Applications
web.config

 Site configuration file


 XML format
 Some settings
 Security
 Session
 Localization
 Tracing
 Debugging
ASP.NET Web Applications
Session Variables

 Store state information


 No longer require cookies
 Share between servers

<sessionState
mode=“StateServer“
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;user
id=sa;password="
cookieless="false"
timeout="20"
/>
Agenda

 Introduction to .NET
 “Classic” ASP
 ASP.NET
 Server controls
 Data controls
 ASP.NET Web applications
 Business objects
 Web services
 Additional topics
Business Objects

 Problems with ASP and DLLs


 DLLs with .NET
Business Objects
Problems with ASP and DLLs

 DLL Locking
 Page hit
 Shutdown Web application
 Shutdown Internet Information Server
 Edit in Visual Interdev
 MTS/COM+
 Shutdown package
 Binary compatibility
 Registry
Business Objects
DLLs with .NET

 Not registered
 Placed in ./bin directory
 Not locked
 Shadow copy
Agenda

 Introduction to .NET
 “Classic” ASP
 ASP.NET
 Server controls
 Data controls
 ASP.NET Web applications
 Business objects
 Web services
 Additional topics
Web Services
What Are Web Services?

 Allow applications to communicate across the Internet


 Platform independent
 Protocol independent
 Synchronous/asynchronous
 Stateful/stateless
 ASP.NET
Web Services

Class
Class Courseware
Courseware
WebMethod
WebMethod
GetPrice
GetPrice
Purchase
Purchase

.ASMX
.ASMX
Web Services

Testing
Courseware.asmx

Test HTML Page

.ASMX
.ASMX
Web Services

WSDL
Courseware.asmx?WSDL

Service Definition(XML)

Proxy
Proxy
DLL
.ASMX
.ASMX
DLL
Web Services

Register for Course Purchase Courseware

Proxy
Proxy
DLL
.ASMX
.ASMX
DLL
Agenda

 Introduction to .NET
 “Classic” ASP
 ASP.NET
 Server controls
 Data controls
 ASP.NET Web applications
 Business objects
 Web services
 Additional topics
Additional Topics

 Deployment
 Scalability
 Caching
 Authentication and authorization
 Availability
Additional Topics
Deployment

 Copy
 Components in .\bin
 No registering DLLs
 No locked DLLs
 Apps are isolated
 Each app can have its own version
 Uninstall
 Delete
Additional Topics
Scalability Improvements

 ASP.NET pages are complied


 State shared across machines
 Managed providers
 Disconnected data access
 Caching
Additional Topics
Caching

 Page output caching


<%@ OutputCache Duration="60" VaryByParam="none" %>

 Page data caching


Cache[“MyDataSet”] = SomeDataSet

 Like application variables


 Scavenging
 Expiration
 Dependencies
Additional Topics
Authentication

 Supports basic, digest, cookie, and Windows authentication,


Passport
 Form-based authentication
 Users or roles
 One API for user info
Session Summary

 ASP.NET offers many enhancements


 Improved session state
 Improved programming model
 Validators
 Caching
 In-place updating of sites
 The list goes on…
Questions?

Potrebbero piacerti anche