Title: Preview of ASP'NET 2'0 in Delphi Course
1Preview of ASP.NET 2.0 in Delphi Course 3182
- Jim Tierney
- Principal Engineer - Borland
2ASP.NET 2.0 Feature Overview
- Agenda
- Overview of many ASP.NET 2.0 features
- Preliminary description of Highlander support for
ASP.NET 2.0
3ASP.NET 2.0 Features(Covered in this
presentation)
- Master Pages and Content Pages
- Themes and Skins
- Data Binding
- Code Separation
- Special Directories
- Build Process
- Precompilation
- Application Services
- Project migration
4New for Highlander
- Webform designer support for Master Pages,
Content Pages, Themes and Skins - BDP DataSource
- ECO DataSource
- Delphi language support for partial classes
- Delphi Code DOM Provider
- Directory-based projects
- Use ASP.NET 2.0 build services
- BDP support for application services
5ASP.NET 2.0 Features
- Master Pages and Content Pages
- Themes and Skins
- Data Binding
- Code Separation
- Special Directories
- Build Process
- Precompilation
- Application Services
- Project migration
6Master Pages and Content Pages
- Master Pages allow you to apply the same layout
to multiple content pages. Typically a Master
page has some markup that will be reused across
multiple content pages (such as a heading) and
one or more aspcontentplaceholder controls that
indicate where content pages can insert
additional markup. - Content pages reference a single master page. A
content page contains one or more aspcontent
controls. The markup within an aspcontent
control is merged with the master page at runtime.
7Master Page
New file extension
- Sample file MasterPage.Master
- lt_at_ Master Language"C" CodeFile"MasterPage.mast
er.cs" Inherits"MasterPage_master" gt - lthtmlgt
- lthead runat"server"gt
- lttitlegtUntitled Pagelt/titlegt
- lt/headgt
- ltbodygt
- ltform id"form1" runat"server"gt
- ltdivgt
- Sample heading
- ltaspcontentplaceholder
id"ContentPlaceHolder1" runat"server"gt - lt/aspcontentplaceholdergt
- Sample footinglt/divgt
- lt/formgt
- lt/bodygt
- lt/htmlgt
New Directive
New directive
New master page control
8Content Page
New attribute
- Sample File Default2.aspx
- lt_at_ Page Language"C" MasterPageFile"/MasterPag
e.master" CodeFile"Default2.aspx.cs"
Inherits"Default2_aspx" Title"Untitled Page" gt - ltaspContent ID"Content1" ContentPlaceHolderID"C
ontentPlaceHolder1" Runat"Server"gt - Sample contentltbr/gt
- ltaspButton ID"Button1"
runat"server" Text"Button" /gt - lt/aspContentgt
New content page control
Reference to control in master
Merge with master
9Master and Content Page
10Master Pages in Highlander
- New Gallery items
- Webform designer support for master and content
pages - See merged content
- Read only areas on content pages
11ASP.NET 2.0 Features
- Master Pages and Content Pages
- Themes and Skins
- Data Binding
- Code Separation
- Special Directories
- Build Process
- Precompilation
- Application Services
- Project migration
12Themes
- Customize the look of a web application
- A collection of .skin and or .css files in a
folder - WebSite1
- app_Themes
- Professional1
- Pro1.skin
- Pro2.skin
- BasicBlue
- Blue.css
- BluePages.skin
- BlueControls.skin
Project directory
Special directory for themes
Directory name is the theme name
The.skin files and stylesheets (.css) make up the
theme (image files are also common)
13.skin files
- Contains one or more
- Default skins
- Applies to all controls of that type
- ltasplabel font-name"tahoma" font-bold"true"
forecolorblue" backcolorwhite" /gt - Named skins
- Applies to controls that reference the id
- ltasplabel skinid"labelred" font-name"tahoma"
font-bold"true" forecolorred"
backcolorwhite" /gt
14Using Themes and Skins
- lt_at_ page themeBasicBlue" gt
- lthtmlgt ltbodygt ltform runat"server"gt
- ltasplabel runat"server idlabel1"gt test
default skin - lt/asplabelgtltbrgt
- ltasplabel runat"server idlabel2
skinidlabelredgt test named skin - lt/asplabelgt
- lt/formgt lt/bodygt lt/htmlgt
Reference to theme
Will use default asplabel skin in the BasicBlue
theme
Reference to named skin
15Highlander Support for Themes and Skins
- New Gallery Items
- Webform designer renders using themes
16ASP.NET 2.0 Features
- Master Pages and Content Pages
- Themes and Skins
- Data Binding
- Code Separation
- Special Directories
- Build Process
- Precompilation
- Application Services
17ASP.NET 2.0 DataSource Controls
- Represent different backend sources
- AspSqlDataSource
- AspXMLDataSource
- AspObjectDataSource
- AspAccessDataSource
- Replacement for non-visual data components used
in ASP.NET 1.1 - DataSet, DataTable, SqlConnection,
SqlDataAdapter, SqlCommand - Built in data manipulation
- Sorting, paging, filtering, updating, deleting,
inserting
18Highlander and Data binding
- Design time support for standard Datasource
controls - Design time support is part of the framework
(rather than built into VS.NET)! - Query builder
- Connection editor
- New Borland Datasource controls
- EcoDataSource
- DataSource component to bind to Eco objects
- BDPDataSource
- DataSource component to connect to BDP databases
19ASP.NET 2.0 Features
- Master Pages and Content Pages
- Themes and Skins
- Data Binding
- Code Separation
- Special Directories
- Build Process
- Precompilation
- Application Services
20Code Separation
- ASP.NET 1.1
- Codebehind
- Codebehind is supported by ASP.NET 2.0 and
ASP.NET 1.1 (but not by VS.NET 2005) - ASP.NET 2.0
- Codebeside
- Codebeside is new to ASP.NET 2.0 and not
compatible with ASP.NET 1.1
21Code Separation
- Codebehind and Codebeside Similarities
- Page consists of a markup file (e.g. .aspx) and
code file (e.g. .cs or .pas) - Markup file contains html and asp control markup
- Code file contains event handlers for asp
controls (e.g. Button1Click, PageLoad) - ASP.NET runtime compiles markup files
- Generates a page class derived from the page
class in the code file - Compiles the generated code into temporary
assemblies
22Code Separation
- Differences
- Document Directives
- Codebehind
- lt_at_ Page Languagec CodebehindDefault.aspx.cs
InheritsWebApplication1.DefaultForm gt - Codebeside
- lt_at_ Page Languagec CodeFileDefault.aspx.cs
InheritsDefaultForm gt - Compilation of code files (e.g. .cs)
- Codebehind
- IDE compiles all code files into a single
assembly (i.e. the codebehind assembly) - Codebeside
- ASP.NET runtime compiles code files at the same
time that markup files are compiled - Code file structure
- Codebehind
- Includes declarations for asp controls in the
code file (e.g. system.web.ui.button button1) - Declares event handlers as private members
- InitializeComponent function assigns event
handlers to asp control event properties - Codebeside
- Declares a partial page class
- No need for asp control declarations in code file
23Code Separation
24Highlander and Code Separation
- Support codebeside for C
- Support codebeside for Delphi
- New Delphi language syntax
- Class fragment
- Delphi Code DOM provider is required because
markup and .pas file are compiled into the same
assembly - Highlander may support codebehind projects
25ASP.NET 2.0 Features
- Master Pages and Content Pages
- Themes and Skins
- Data Binding
- Code Separation
- Special Directories
- Build Process
- Precompilation
- Application Services
26Special Directories
- Folders in the project directory that have
special meaning to the ASP.NET runtime - /Bin was the only ASP.NET 1.1 special directory
27Special Directories
- (Partial list)
- Bin
- Contains assemblies required to build the app
- app_code
- Contains .cs and .pas files that are not
associated with a markup file - app_webreferences
- .wsdl and .disco files created by Add Web
Reference command - No code files (code is automatically generated as
part of the asp.net runtime build process) - app_data
- Application data files such as
- .xml data files
- mdf database files
- app_themes
- Theme directories
- .skin files
28Highlander and Special Directories
- Support directory-based ASP.NET projects
- No .bdsproj or .dpr file
- All files in the project directory are part of
the project - File/Open/Web Site prompts for a directory
rather than project file - Assembly references are declared in web.config
rather than a project file - Projects created by VS.NET open in Highlander
without changes - Project created by Highlander open in VS.NET
without changes
29ASP.NET 2.0 Features
- Master Pages and Content Pages
- Themes and Skins
- Data Binding
- Code Separation
- Special Directories
- Build Process
- Precompilation
- Application Services
- Localization Resources
- Control designer features
- Mobile Device Support
- Project migration
30Build Process
- ASP.NET 1.1
- Code must be generated by a tool
- Web service proxies
- Typed data sets
- Assemblies must be built by a tool
- Code behind assembly
- Resource assemblies
- ASP.NET runtime processes markup files only
- Generates code (e.g. c)
- Compiles generated code, referencing assemblies
in /bin - ASP.NET 2.0
- ASP.NET runtime processes markup files similar to
1.1 - In addition, scans the files in the project
directory, automatically performing code
generation and compilation for many file types - Code files (.cs using codedom providers
registered in machine.config and web.config) - Localization resources (.resx using resgen.exe)
- Web Services (.wsdl, .discomap using wsdl.exe)
- Typed data sets (.xsd using xsd.exe)
31Build Process
32Codedom Providers
- Codedom providers are similar in 1.1 and 2.0
- Two responsibilities
- Convert a codedom into source code
- ASP.NET runtime generates a codedom from markup
- Other tools generate codedoms
- Wsdl import tool (wsdl.exe)
- Xsd import tool (xsd.exe) to generate typed data
sets - Compile code into an assembly
- ASP.NET 2.0 runtime relies more heavily on
codedom providers - Compile codebeside associated with web forms,
user controls and web services - Compile source files in /code directory
- Generate and compile code
- Wsdl import
- Xsd import
- Strongly typed resources (See Localization
Resources topic) - User profile classes (See Application Services
topic)
33Highlander and Build Process
- Use ASP.NET build services to verify syntax of
project files - Verifies all files that will be built by the
ASP.NET runtime, not just code files - Finds markup file (.aspx) syntax errors
- Finds web.config errors
34ASP.NET 2.0 Features
- Master Pages and Content Pages
- Themes and Skins
- Data Binding
- Code Separation
- Special Directories
- Build Process
- Precompilation
- Application Services
- Project migration
35Precompilation
- Batch compiles all pages in the site
- Improves performance the first time the website
is accessed - Two types of precompilation
- In-place precompilation
- Equivalent to browsing to all the pages in the
app - Invoked with special URL http/localhost/WebSite1
/Precompile.axd - Precompilation for Deployment
- Removes source code to protect IP
- Can choose to remove markup or leave in place so
that it can be customized later - Invoked using aspnet_compiler.exe
- aspnet_compiler -v /ltwebsitenamegt -p ltsourcegt
ltdestinationgt
36Highlander and Precompilation
- Precompilation commands within the IDE
- Deployment manager support for copying
precompiled projects over FTP
37ASP.NET 2.0 Features
- Master Pages and Content Pages
- Themes and Skins
- Data Binding
- Code Separation
- Special Directories
- Build Process
- Precompilation
- Application Services
- Project migration
38Application Services
- Provider Model pattern
- Types of providers
- Provider Implementations
- Web site configuration tool
39Provider Model Pattern
- Multiple provider types
- Each type has a well defined interface
- Allows for different implementation of a provider
type - Use SQLServer
- User defined class
- Web application code is independent of provider
implementation - Web.config defines implementation of provider
- Assembly name
- Class name
- ASP.NET infrastructure responsible for
instantiating provider defined in web.config
40Types of Providers
- Membership Provider
- User names, passwords, password hints
- Profile Provider
- User profile (e.g. shopping cart)
- Personalization Provider
- User personalization (e.g. preferred background
color) - Role Provider
- List of names
- Associate roles with users to deny users access
to parts of web site
41Provider Implementations
- MS implementations declared in machine.config
- ltroleManagergt
- ltprovidersgt
- ltadd name"AspNetSqlRoleProvider
- connectionStringName"LocalSqlServer"
applicationName"/" type"System.Web.Security.
SqlRoleProvider, System.Web, Version2.0.3600.0,
Cultureneutral, PublicKeyTokenb03f5f7f11d50a3a"
/gt - ltadd name"AspNetWindowsTokenRoleProvider
- applicationName"/" type"System.Web.Security.Win
dowsTokenRoleProvider, System.Web,
Version2.0.3600.0, Cultureneutral,
PublicKeyTokenb03f5f7f11d50a3a" /gt - ltadd name"AspNetAccessProvider"
- connectionStringName"AccessFileName"
applicationName"/" type"System.Web.Security.Acce
ssRoleProvider, System.Web, Version2.0.3600.0,
Cultureneutral, PublicKeyTokenb03f5f7f11d50a3a"
/gt - lt/providersgt
- lt/roleManagergt
- Web Site Configuration Tool
- Use to select an implementation from
machine.config or web.config - Updates web.config
- ltroleManager enabled"True" defaultProvider"AspNe
tSqlRoleProvider" /gt - SQLServer setup
- SQLServer setup wizard
- Aspnet_regsql.exe
- Creates or configures a SQLServer database to
store information for ASP.NET application
services
42Web Site Configuration Tool
- Modifies web.config
- Select provider implementations
- Invokes providers
- Role Provider
- Edit roles
- Membership provider
- Edit users
43Highlander and Application Services
- Launch Web Site Configuration Tool from IDE
- BDP Provider implementations
- Tool to create database and tables
- BDP provider assemblies
- Delphi Installer declares BDP providers in
machine.config - Allows web site administration tool to select BDP
providers - Deployment manager deploys BDP provider assemblies
44ASP.NET 2.0 Features
- Master Pages and Content Pages
- Themes and Skins
- Data Binding
- Code Separation
- Special Directories
- Build Process
- Precompilation
- Application Services
- Project migration
45Project Migration
- Opening a Delphi 2005 project in Highlander
- Conversion
- Move files to special directories
- Convert codebehind to codebeside
- Change to partial classes
- Remove declarations of controls for code file
- Declare event handlers as protected
- Backward compatibility
- Support codebehind
- Designer has component tray
46Summary
- New for Highlander
- Directory-based projects
- Use ASP.NET 2.0 build services
- Delphi language support for partial classes
- Delphi Code DOM Provider
- Borland BDP Providers for application services
- BDP DataSource
- ECO DataSource
- Webform designer support for Master Pages,
Content Pages, Themes and Skins
47Thank You
- Questions?
- Steve Trefethens blog
- http//blogs.borland.com/stevet/