Title: Malek Kemmou
1Overview of ASP.NET 2.0
- Malek Kemmou
- Technology Architect, Application Platform
- Microsoft Middle East and Africa
- malek_at_microsoft.com
2New Features at a Glance
Data Controls
Login Controls
Web Parts
Other New Controls
Controls
Master Pages
Themes and Skins
Localization
Compilation
Page Framework
Membership
Role Management
Profiles
Configuration
Services and APIs
Site Maps
Health Monitoring
Other Services
3What's New in Data Access
- Data source controls
- Declarative 2-way data binding
- Data controls
- GridView - Like the DataGrid, only better
- DetailsView - Companion to GridView
- SQL cache dependencies
- Key cached items to database entities
- Simplified data binding expressions
4Data Binding
5What's New for UIs
- Master pages
- "Visual inheritance" for Web pages
- Applied declaratively or programmatically
- Themes and skins
- Theme controls, pages, and entire sites
- Applied declaratively or programmatically
- New controls (more than 50 in all)
- Menus, TreeViews, Wizards, and more
6Theming a Page
lt_at_ Page Theme"BasicBlue"gt
Before
After
7Master Pages
8What's New in Security
- Membership service
- Service for managing users and credentials
- Provider-based for flexible data storage
- Login controls
- Controls for logging in, creating new users,
recovering lost passwords, and more - Role Management service
- Combine forms authentication and role-based
authorization without writing code!
9Membership and Logins
10Profiles
- Store per-user data persistently
- Strongly typed access (unlike session state)
- On-demand lookup (unlike session state)
- Long-lived (unlike session state)
- Supports authenticated and anonymous users
- Accessed through dynamically compiled
HttpProfileBase derivatives (HttpProfile) - Provider-based for flexible data storage
11Defining a Profile
ltconfigurationgt ltsystem.webgt ltprofilegt
ltpropertiesgt ltadd name"ScreenName" /gt
ltadd name"Posts" type"System.Int32"
defaultValue"0" /gt ltadd name"LastPost"
type"System.DateTime" /gt lt/propertiesgt
lt/profilegt lt/system.webgt lt/configurationgt
12Persisting Data with Profiles
13Site Navigation
- Navigation UIs are tedious to implement
- Especially if they rely on client-side script
- New controls simplify site navigation
- TreeView and Menu - Navigation UI
- SiteMapDataSource - XML site maps
- SiteMapPath - "Bread crumb" control
- Public API provides foundation for controls
- Provider-based for flexibility
14Data-Driven Site Navigation
15Providers
- New model for storing and managing state
- Makes storage adaptable to different media
- Used by many key ASP.NET services
- Membership service
- Role Management service and more
- Built-in providers make ASP.NET state storage
very flexible - Custom providers make it infinitely flexible
16The Provider Model
Controls
Login
LoginStatus
LoginView
Other Login Controls
Membership API
Membership
MembershipUser
Membership Providers
AccessMembershipProvider
Other Membership Providers
SqlMembershipProvider
Membership Data
Access
SQL Server
Other Data Stores
17Configuration
- Administrative tools
- ASP.NET MMC snap-in
- Web Site Administration Tool (Webadmin.axd)
- Configuration API
- Read/write access to configuration settings
- Simplified custom configuration sections
- Instrumentation
- Perf counters, health monitoring, and more
18Web Parts
- Framework for building portal-style apps
- Patterned after SharePoint Portal Server
- System.Web.UI.WebControls.WebParts
- Rich UIs with minimal code
- Edit page layout using drag-and-drop
- Edit appearance and behavior and more
- Seamless personalization
- Intercommunication ("connections")
19Web Parts
20What's New in Mobility
- Unified Control Architecture
- Adapters enable pages and controls to render
markup for different device types - WML adapters provided by third parties
- Device filters
ltaspLabel Text"Hello, world" RunAt"server"
NokiaText"Hello, Nokia" UpText"Hello,
OpenWave" /gt
OpenWave browsers
Nokia browsers
21What's New in Localization
- Auto-culture handling
- Declarative mapping of Accept-Language headers to
relevant thread properties - Simplified resource handling
- Declarative mapping of control properties to
resources using lt gt expressions - Strongly typed programmatic resource loading
- ltasplocalize runat"server"gt and more
22Code-Behind 2.0
Hello.aspx
lt_at_ Page CompileWith"Hello.aspx.cs"
ClassName"MyPage_aspx" gt lthtmlgt ltbodygt
ltform runat"server"gt ltaspTextBox
ID"Input" RunAt"server" /gt ltaspButton
Text"Test" OnClick"OnTest" RunAt"server" /gt
ltaspLabel ID"Output" RunAt"server" /gt
lt/formgt lt/bodygt lt/htmlgt
23Code-Behind 2.0
Hello.aspx
lt_at_ Page CompileWith"Hello.aspx.vb"
ClassName"MyPage_aspx" gt lthtmlgt ltbodygt
ltform runat"server"gt ltaspTextBox
ID"Input" RunAt"server" /gt ltaspButton
Text"Test" OnClick"OnTest" RunAt"server" /gt
ltaspLabel ID"Output" RunAt"server" /gt
lt/formgt lt/bodygt lt/htmlgt
24Code-Behind 2.0, Cont.
Hello.aspx.cs
using System partial class MyPage_aspx
void OnTest (object sender, EventArgs e)
Output.Text "Hello, " Input.Text
25Cross-Page Posting
- Pages can now post back to other pages
- Relevant properties
- control.PostBackUrl - Identifies postback target
- Page.PreviousPage - Returns reference to page
that originated a cross-page postback - PreviousPage.IsCrossPagePostBack - Reveals
whether a cross-page postback occurred - _at_ PreviousPageType directive provides strongly
typed access to previous page
26Posting Back to Another Page
lthtmlgt ltbodygt ltform runat"server"gt
ltaspTextBox ID"Input" RunAt"server" /gt
ltaspButton Text"Test" PostBackUrl"PageTwo.aspx"
RunAt"server" /gt lt/formgt lt/bodygt lt/htmlgt
27Get the beta
- http//www.microsoft.com/betaexperience
- Fill out the form, and youll get the DVD (no
cost, not even shipping!!!)
28Questions