Agenda
Introduction Architecture Master Pages Personalization Building a site with Web Parts. Skins and Themes Administration & Management Site Navigation (Optional) Handling data with ASP.NET 2.0 (Optional) Summary
Web Parts
Page Framework
Master Pages
Compilation
Membership
Role Management
Site Maps Health Monitoring
Profiles
Configuration
Other Services
Architecture
Batch Compilation
Like in asp1.1 <compilation batch="true|false" batchTimeout="number of seconds" maxBatchSize="maximum number of pages per batched compilation" maxBatchGeneratedFileSize="maximum combined size (in KB) of the generated source file per batched compilation </compilation>
PB = Post Back
Architecture - Extensibilty
New HttpModules SessionID Role Management Anonymous Identification Profile Page Counters New Handlers
WebAdminHandler
TraceHandler WebResourcesHandler PrecomHandler More
Architecture Performance
Improved Request Pipeline
Up to 30% percent improved request stack
Master Pages
default.aspx
<%@ Page MasterPageFile="Site.master" %> <asp:Content ContentPlaceHolderID= "Main" RunAt="server" />
http://.../default.aspx
</asp:Content>
Applying
<%@ Page MasterPageFile="~/Site.master" %> <asp:Content ContentPlaceHolderID="Main" RunAt="server"> This content fills the place holder "Main" defined in the master page </asp:Content>
Master Pages
Applying to a site
<configuration> <system.web> <pages masterPageFile="~/Site.master" /> </system.web> </configuration>
Applying Programmatically
Sub Page_PreInit (ByVal sender As Object,ByVal e As EventArgs) Page.MasterPageFile = "~/Site.master" End Sub
<!-- Orders.Master --> <%@ Master MasterPageFile="~/Site.Master" %> <asp:Content ContentPlaceHolderID="..." RunAt="server"> <asp:ContentPlaceHolder ID="..." RunAt="server"> ... </asp:ContentPlaceHolder> <asp:Content>
Personalization
Personalization - Overview
Automatic association between the end user viewing the page and any data points stored for that user. The personalization properties that are maintained on a per-user basis are stored on the server and not on the client. The end user can access these personalization properties on later site visits. Ideal way to start creating highly customizable and user-specific sites without massing with all the underlined code.
Personalization - Groups
Configuration <group name=MemberDetails> <add name=Member /> <add name=DateJoined /> <add name=PaidDuesStatus /> <add name=Location /> </group>
Using
Label1.Text = Profile.MemberDetails.DateJoined
Personalization - Types
Define types to the fields Use default values to the fields Define readonly for fields Create custom types for fields and serialization type.
Web Parts
Web Parts
Orchestrates operation of Web Parts
Maintains list of Web Parts and zones Manages page state (e.g., display mode) and fires events when page state changes Facilitates communication between Web Parts Manages personalization and much more
Description
"Normal" display mode; no editing (default) Permits drag-and-drop layout editing Permits editing of Web Parts' appearance and behavior Permits Web Parts to be added to the page Permits connections to be established between Web parts
DeclarativeCatalogPart
On a Site
<configuration> <system.web> <pages theme="BasicBlue" /> </system.web> </configuration>
Programmatically
Sub Page_PreInit (ByVal sender As Object, ByVal e As EventArgs) Page.Theme = "BasicBlue" End Sub
SKIN
BasicBlue
SKIN
SmokeAndGlass
SKIN SKIN
ShockingPink
SKIN SKIN
AutumnLeaves
SKIN SKIN
A&M - Overview
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
Invoked by requesting Webadmin.axd or using the "ASP.NET Configuration" command in Visual Studio's Website menu
Description
Returns a Configuration object representing config settings for a managed EXE Returns a Configuration object representing configuration settings for the specified server Returns a Configuration object representing configuration settings for the specified Web application Returns a ConfigurationSectionGroup object representing the specified section group Returns a ConfigurationSection object representing the specified section (e.g., <appSettings> Records changes in the relevant configuration file
GetMachineConfiguration
GetWebConfiguration
GetSectionGroup
GetSection
Update
Description
Returns an AppSettingsSection object representing the <appSettings> section Returns a ConnectionStringsSection object representing the <connectionsStrings> section True if there's a corresponding configuration file, false if not Path to the app represented by this Configuration object Returns a ConfigurationSectionGroupCollection representing all section groups Returns a ConfigurationSectionCollection representing all sections
ConnectionStrings
Sections
Description
New peformance counters supplement the ones introduced in ASP.NET 1.x Integration with ETW subsystem to support low-overhead tracing of HTTP requests through the system ASP.NET trace facility upgraded with new features and to allow coupling to System.Diagnostics.Trace New provider-based subsystem for logging notable events ("Web events") that occur during an application's lifetime
Application tracing
Health monitoring
Handling Data
Site Navigation
Providers
XmlSiteMapProvider
Site Maps
Web.sitemap Other Data Stores
<asp:Menu Orientation="Horizontal" RunAt="server"> <Items> <asp:MenuItem Text="Training" RunAt="server"> <asp:MenuItem Text="Programming .NET" RunAt="server" Navigateurl="Classes.aspx?id=1" /> <asp:MenuItem Text="Programming ASP.NET" RunAt="server" NavigateUrl="Classes.aspx?id=2" /> <asp:MenuItem Text="Programming Web Services" RunAt="server" NavigateUrl="Classes.aspx?id=3" /> </asp:MenuItem> <asp:MenuItem Text="Consulting" RunAt="server" NavigateUrl="Consulting.aspx" /> <asp:MenuItem Text="Debugging" RunAt="server" NavigateUrl="Debugging.aspx" /> </Items> </asp:Menu>
<siteMap> <siteMapNode title="Home" description="" url="default.aspx"> <siteMapNode title="Training" url="Training.aspx" description="Training for .NET developers"> <siteMapNode title="Programming .NET" url="Classes.aspx?id=1" description="All about the .NET Framework" /> <siteMapNode title="Programming ASP.NET" url="Classes.aspx?id=2" description="All about ASP.NET" /> <siteMapNode title="Programming Web Services" url="Classes.aspx?id=3" description="All about Web services" /> </siteMapNode> <siteMapNode title="Consulting" url="Consulting.aspx" description="Consulting for .NET projects" /> <siteMapNode title="Debugging" url="Debugging.aspx" description="Help when you need it the most" /> </siteMapNode> </siteMap>
Web.sitemap
<siteMap> <siteMapNode title="Home" description="" url="default.aspx"> <siteMapNode title="Training" url="Training.aspx" description="Training for .NET developers"> <siteMapNode title="Programming .NET" url="Classes.aspx?id=1" description="All about the .NET Framework" /> <siteMapNode title="Programming ASP.NET" url="Classes.aspx?id=2" description="All about ASP.NET" /> <siteMapNode title="Programming Web Services" url="Classes.aspx?id=3" description="All about Web services" /> </siteMapNode> <siteMapNode title="Consulting" url="Consulting.aspx" description="Consulting for .NET projects" /> <siteMapNode title="Debugging" url="Debugging.aspx" description="Help when you need it the most" /> </siteMapNode> </siteMap>
Web.sitemap
<siteMap> <siteMapNode title="Home" description="" url="default.aspx"> <siteMapNode title="Training" url="Training.aspx" description="Training for .NET developers"> <siteMapNode title="Programming .NET" url="Classes.aspx?id=1" description="All about the .NET Framework" /> <siteMapNode title="Programming ASP.NET" url="Classes.aspx?id=2" description="All about ASP.NET" /> <siteMapNode title="Programming Web Services" url="Classes.aspx?id=3" description="All about Web services" /> </siteMapNode> <siteMapNode title="Consulting" url="Consulting.aspx" description="Consulting for .NET projects" /> <siteMapNode title="Debugging" url="Debugging.aspx" description="Help when you need it the most" /> </siteMapNode> </siteMap>
Summary ASAP.Net
New features to simplify repetitive coding tasks New provider model offers extra extensibility New compilation model fixes old base/derived class problem Its stronger, faster, prettier and with a better engine. Wouldnt you like to give it a test drive ?