Noam King CTO Sela Youniversity
Noam King CTO Sela Youniversity
Noam King
CTO
Sela youniversity
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
Introduction to ASP.NET 2.0
Controls
Data
Data Login
Login Other
OtherNew
New
Web
WebParts
Parts
Controls
Controls Controls
Controls Controls
Controls
Framework
Themes Mobility
Mobilityand
Page
Role
Role
Membership Profiles Configuration
and APIs
Services
Site
Site Health
Health Other
Other
Maps
Maps Monitoring
Monitoring Services
Services
Architecture
Architecture – Code Model
Constructor ProcessPostData1
Construct OnPreLoad
TestDeviceFilter OnLoad
AddParsedSubObject ProcessPostData2 (PB)
DeterminePostBackMode RaiseChangedEvents (PB)
OnPreInit RaisePostBackEvent (PB)
OnLoadComplete
LoadPersonalizationData
OnPreRender
InitializeThemes OnPreRenderComplete
OnInit SavePersonalizationData
ApplyControlSkin SaveControlState
ApplyPersonalization SaveViewState
OnInitComplete SavePageStateToPersistenceMedium
LoadPageStateFromPersistenceMedium Render
(PB) OnUnload
LoadControlState (PB)
LoadViewState (PB)
PB = Post Back
Architecture – Code Page Posting
If Page.IsCrossPagePostBack Then
Label1.Text = “Hello “ &
PreviousPage.pp_Textbox1.Text &
“<br />” & _
“Date Selected: “ & _
PreviousPage.pp_Calendar1.Sele
ctedDate.ToShortDateString()
Else
Response.Redirect(“Page1.aspx”)
End If
Architecture - Extensibilty
•New HttpModules
•SessionID
•Role Management
•Anonymous Identification
•Profile
•Page Counters
•New Handlers
• WebAdminHandler
•TraceHandler
•WebResourcesHandler
•PrecomHandler
•More…
Architecture – Performance
</asp:Content>
</asp:Content>
Master Pages – Defining and
applying
Defining
<%@ Master %>
Applying
<%@ Page MasterPageFile="~/Site.master" %>
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
Master Pages – Weak Typing
Get
return Title.Text
End Get
Set
Title.Text = value
End Set
End Property
</script>
Master Page
IDF (idf.master)
Using
Profile.FirstName = TextBox1.Text
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
<asp:WebPartZone ID="WeatherZone"
DragHighlightColor="244,198,96" RunAt="server">
RunAt="server"
<PartTitleStyle BackColor="#2254B1" ForeColor="White" />
<PartStyle BorderColor="#81AAF2" BorderStyle="Solid" BorderWidth="1px" />
<ZoneTemplate>
<!-- Web Parts declared here -->
</ZoneTemplate>
</asp:WebPartZone>
Web Parts - Controls
DeclarativeCatalogPart
Web Parts - EditorZone
On a Site
<configuration>
<system.web>
<pages theme="BasicBlue" />
</system.web>
</configuration>
Programmatically
Page.Theme = "BasicBlue"
End Sub
Skins And Themes – Global
ASP.NET-
ClientFiles
Theme name =
Subdirectory name
Themes
SKIN
BasicBlue SKIN
SKIN
Smoke-
SKIN
AndGlass
Skins and Themes - Local
vroot
Theme name =
Subdirectory name
Themes
SKIN
Shocking-
SKIN
Pink
SKIN
Autumn-
SKIN
Leaves
Skins and Themes – Named Skins
...
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
A&M – ASP.NET MMC Snap-In
Invoked by requesting
Webadmin.axd or using
the "ASP.NET Configuration"
command in Visual Studio's
Website menu
A&M – Configuration class
Name Description
Application tracing ASP.NET trace facility upgraded with new features and
to allow coupling to System.Diagnostics.Trace
SqlDataSource
Enables you to work with any SQL-based database, such as Microsoft SQL Server or Oracle.
AccessDataSource
Enables you to work with a Microsoft Access file (.mbd).
ObjectDataSource
Enables you to work with a business object or a Visual Studio 2005 data component.
XmlDataSource
Enables you to work with the information from an XML file or an XML source (for example an
RSS feed).
SiteMapDataSource
Enables you to work with the hierarchical data represented in the site map file (.sitemap).
DataSetDataSource
Enables you to work with data that is represented in a DataSet object.
Handling Data – Data Bound Server
controls
<asp:GridView>
<asp:DataGrid>
<asp:DetailsView>
<asp:TreeView>
<asp:Menu>
<asp:DataList>
<asp:Repeater>
<asp:DropDownList>
<asp:BulletedList>
<asp:CheckBoxList>
<asp:RadioButtonList>
<asp:ListBox>
<asp:AdRotator>
Site Navigation
Site Navigation - Overview
Controls SiteMap-
Menu TreeView SiteMap- SiteMapPath
Menu TreeView DataSource SiteMapPath
DataSource
SiteMapNode
SiteMapNode SiteMapNode
SiteMapNode SiteMapNode
SiteMapNode
Providers Other
XmlSiteMapProvider OtherSite
SiteMap
Map
XmlSiteMapProvider Providers
Providers
Site Maps
Other
Web.sitemap
Data Stores
Site Navigation – TreeView Example
<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>
Site Navigation – TreeView and
SiteMap
<asp:SiteMapDataSource ID="SiteMap" RunAt="server" />
<asp:TreeView DataSourceID="SiteMap" RunAt="server" />
Web.sitemap
<siteMap>
<siteMap>
<siteMapNode title="Home" description="" url="default.aspx">
<siteMapNode
<siteMapNode title="Home" description=""
title="Training" url="default.aspx">
url="Training.aspx"
<siteMapNode title="Training"
description="Training for .NETurl="Training.aspx"
developers">
description="Training
<siteMapNode for .NET .NET"
title="Programming developers">
url="Classes.aspx?id=1"
<siteMapNode title="Programming
description="All about the .NET .NET" url="Classes.aspx?id=1"
Framework" />
description="All
<siteMapNode about the .NET
title="Programming Framework"
ASP.NET" />
url="Classes.aspx?id=2"
<siteMapNode title="Programming
description="All about ASP.NET" ASP.NET"
/> url="Classes.aspx?id=2"
description="All
<siteMapNode about ASP.NET"
title="Programming Web />
Services" url="Classes.aspx?id=3"
<siteMapNode title="Programming
description="All Web Services"
about Web services" /> url="Classes.aspx?id=3"
description="All
</siteMapNode> about Web services" />
</siteMapNode>
<siteMapNode title="Consulting" url="Consulting.aspx"
<siteMapNode title="Consulting"
description="Consulting for .NETurl="Consulting.aspx"
projects" />
description="Consulting
<siteMapNode for url="Debugging.aspx"
title="Debugging" .NET projects" />
<siteMapNode title="Debugging"
description="Help when you needurl="Debugging.aspx"
it the most" />
description="Help when you need it the most" />
</siteMapNode>
</siteMapNode>
</siteMap>
</siteMap>
Site Navigation – Menu and SiteMap
Web.sitemap
<siteMap>
<siteMap>
<siteMapNode title="Home" description="" url="default.aspx">
<siteMapNode
<siteMapNode title="Home" description=""
title="Training" url="default.aspx">
url="Training.aspx"
<siteMapNode title="Training"
description="Training for .NETurl="Training.aspx"
developers">
description="Training
<siteMapNode for .NET .NET"
title="Programming developers">
url="Classes.aspx?id=1"
<siteMapNode title="Programming
description="All about the .NET .NET" url="Classes.aspx?id=1"
Framework" />
description="All
<siteMapNode about the .NET
title="Programming Framework"
ASP.NET" />
url="Classes.aspx?id=2"
<siteMapNode title="Programming
description="All about ASP.NET" ASP.NET"
/> url="Classes.aspx?id=2"
description="All
<siteMapNode about ASP.NET"
title="Programming Web />
Services" url="Classes.aspx?id=3"
<siteMapNode title="Programming
description="All Web Services"
about Web services" /> url="Classes.aspx?id=3"
description="All
</siteMapNode> about Web services" />
</siteMapNode>
<siteMapNode title="Consulting" url="Consulting.aspx"
<siteMapNode title="Consulting"
description="Consulting for .NETurl="Consulting.aspx"
projects" />
description="Consulting
<siteMapNode for url="Debugging.aspx"
title="Debugging" .NET projects" />
<siteMapNode title="Debugging"
description="Help when you needurl="Debugging.aspx"
it the most" />
description="Help when you need it the most" />
</siteMapNode>
</siteMapNode>
</siteMap>
</siteMap>
Site Navigation – SiteMap API