Your SlideShare is downloading. ×
0
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Aspnet2 Overview
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Aspnet2 Overview

2,307

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,307
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
135
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. ASAP to ASP.NET 2.0 Noam King CTO Sela youniversity
  • 2. Agenda <ul><li>Introduction </li></ul><ul><li>Architecture </li></ul><ul><li>Master Pages </li></ul><ul><li>Personalization </li></ul><ul><li>Building a site with Web Parts. </li></ul><ul><li>Skins and Themes </li></ul><ul><li>Administration &amp; Management </li></ul><ul><li>Site Navigation (Optional) </li></ul><ul><li>Handling data with ASP.NET 2.0 (Optional) </li></ul><ul><li>Summary </li></ul>
  • 3. Introduction to ASP.NET 2.0 Data Controls Login Controls Web Parts Other New Controls Master Pages Themes and Skins Mobility and Localization Compilation Membership Role Management Profiles Configuration Site Maps Health Monitoring Other Services Controls Page Framework Services and APIs
  • 4. Architecture
  • 5. Architecture – Code Model <ul><li> ASP 1.1 ASP 2.0 </li></ul>
  • 6. Architecture – Coding Model (cont.) <ul><li>Reduced Inheritance Complexity </li></ul><ul><ul><li>No need for declaration code </li></ul></ul><ul><ul><li>Code is linked by VS2005 and the runtime </li></ul></ul><ul><li>Reduced Compilation Complexity </li></ul><ul><ul><li>Code-behind automatically synchronized with aspx page </li></ul></ul><ul><ul><li>More compilation models </li></ul></ul>
  • 7. Architecture – Coding Model (cont.) Compilation <ul><li>Normal </li></ul><ul><ul><li>Similar to Asp 1.1 </li></ul></ul><ul><li>Batch Compilation </li></ul><ul><ul><li>Like in asp1.1 </li></ul></ul><ul><ul><li>&lt;compilation batch =&amp;quot;true|false&amp;quot; batchTimeout =&amp;quot;number of seconds&amp;quot; maxBatchSize =&amp;quot;maximum number of pages per batched compilation&amp;quot; maxBatchGeneratedFileSize =&amp;quot;maximum combined size (in KB) of the generated source file per batched compilation“ </li></ul></ul><ul><ul><li>&lt;/compilation&gt; </li></ul></ul>
  • 8. Architecture – Coding Model (cont.) Compilation (cont.) <ul><li>Deployment pre-compilation </li></ul><ul><ul><li>aspnet_compiler /v /&lt;websitename&gt; –p &lt;source&gt; </li></ul></ul><ul><ul><li>HTML pages, resources, configuration files, and ASPX pages are copied separately. </li></ul></ul><ul><ul><li>Stub files for the various aspx pages. </li></ul></ul><ul><ul><li>Increased performance and increased security. </li></ul></ul>
  • 9. Architecture – Coding Model (cont.) Compilation (cont.) <ul><li>In Place Compliation </li></ul><ul><ul><li>http:// localhost/mywebsitename/precompile.axd </li></ul></ul><ul><ul><li>Eliminate performance hit of batch compilation </li></ul></ul><ul><ul><li>Let you find compilation errors before your users do. </li></ul></ul><ul><li>Full Runtime Compilation (The Code Directory) </li></ul><ul><ul><li>the Code directory is designed for storing class files to be compiled dynamically at run time. </li></ul></ul><ul><ul><li>Simple deployment </li></ul></ul>
  • 10. Architecture – Page LifeCycle <ul><li>Constructor </li></ul><ul><li>Construct </li></ul><ul><li>TestDeviceFilter </li></ul><ul><li>AddParsedSubObject </li></ul><ul><li>DeterminePostBackMode </li></ul><ul><li>OnPreInit </li></ul><ul><li>LoadPersonalizationData </li></ul><ul><li>InitializeThemes </li></ul><ul><li>OnInit </li></ul><ul><li>ApplyControlSkin </li></ul><ul><li>ApplyPersonalization </li></ul><ul><li>OnInitComplete </li></ul><ul><li>LoadPageStateFromPersistenceMedium </li></ul><ul><li>(PB) </li></ul><ul><li>LoadControlState (PB) </li></ul><ul><li>LoadViewState (PB) </li></ul>ProcessPostData1 OnPreLoad OnLoad ProcessPostData2 (PB) RaiseChangedEvents (PB) RaisePostBackEvent (PB) OnLoadComplete OnPreRender OnPreRenderComplete SavePersonalizationData SaveControlState SaveViewState SavePageStateToPersistenceMedium Render OnUnload PB = Post Back
  • 11. Architecture – Code Page Posting If Page.IsCrossPagePostBack Then Label1.Text = “Hello “ &amp; PreviousPage.pp_Textbox1.Text &amp; “&lt;br /&gt;” &amp; _ “ Date Selected: “ &amp; _ PreviousPage.pp_Calendar1.Sele ctedDate.ToShortDateString() Else Response.Redirect(“Page1.aspx”) End If
  • 12. Architecture - Extensibilty <ul><li>New HttpModules </li></ul><ul><ul><li>SessionID </li></ul></ul><ul><ul><li>Role Management </li></ul></ul><ul><ul><li>Anonymous Identification </li></ul></ul><ul><ul><li>Profile </li></ul></ul><ul><ul><li>Page Counters </li></ul></ul><ul><li>New Handlers </li></ul><ul><ul><li>WebAdminHandler </li></ul></ul><ul><ul><li>TraceHandler </li></ul></ul><ul><ul><li>WebResourcesHandler </li></ul></ul><ul><ul><li>PrecomHandler </li></ul></ul><ul><ul><li>More… </li></ul></ul>
  • 13. Architecture – Performance <ul><li>Improved Request Pipeline </li></ul><ul><ul><li>Up to 30% percent improved request stack </li></ul></ul><ul><li>Improved Memory management with IIS6 </li></ul><ul><ul><li>Working set for the worker process reduced by around 50%. </li></ul></ul><ul><ul><li>General improvements on II6 </li></ul></ul><ul><li>More to come in the release </li></ul>
  • 14. Master Pages
  • 15. Master Pages - Basics <ul><li>Masters define common content and placeholders (&lt;asp:ContentPlaceHolder&gt;) </li></ul><ul><li>Content pages reference masters and fill placeholders with content (&lt;asp:Content&gt;) </li></ul>&lt;%@ Master %&gt; &lt;asp:ContentPlaceHolder ID=&amp;quot;Main&amp;quot; RunAt=&amp;quot;server&amp;quot; /&gt; &lt;%@ Page MasterPage- File=&amp;quot;Site.master&amp;quot; %&gt; &lt;asp:Content ContentPlaceHolderID= &amp;quot;Main&amp;quot; RunAt=&amp;quot;server&amp;quot; /&gt; &lt;/asp:Content&gt; Site.master default.aspx http://.../default.aspx
  • 16. Master Pages – Defining and applying <ul><li>Defining </li></ul>&lt;%@ Master %&gt; &lt;%@ Page MasterPageFile=&amp;quot;~/Site.master&amp;quot; %&gt; &lt;asp:Content ContentPlaceHolderID=&amp;quot;Main&amp;quot; RunAt=&amp;quot;server&amp;quot;&gt; This content fills the place holder &amp;quot;Main&amp;quot; defined in the master page &lt;/asp:Content&gt; <ul><li>Applying </li></ul>
  • 17. Master Pages <ul><li>Applying to a site </li></ul>&lt;configuration&gt; &lt;system.web&gt; &lt;pages masterPageFile=&amp;quot;~/Site.master&amp;quot; /&gt; &lt;/system.web&gt; &lt;/configuration&gt; Sub Page_PreInit (ByVal sender As Object,ByVal e As EventArgs) Page.MasterPageFile = &amp;quot;~/Site.master&amp;quot; End Sub <ul><li>Applying Programmatically </li></ul>
  • 18. Master Pages – Weak Typing (CType(Master.FindControl (&amp;quot;Title&amp;quot;), Label).Text = &amp;quot;Orders&amp;quot; In the content page… &lt;asp:Label ID=&amp;quot;Title&amp;quot; RunAt=&amp;quot;server&amp;quot; /&gt; In the master page…
  • 19. Master Pages – Strong Typing Master.TitleText = &amp;quot;Orders&amp;quot; In the content page… &lt;asp:Label ID=&amp;quot;Title&amp;quot; RunAt=&amp;quot;server&amp;quot; /&gt; . . . &lt;script language=“VB&amp;quot; runat=&amp;quot;server&amp;quot;&gt; Public Property TitleText as string Get return Title.Text End Get Set Title.Text = value End Set End Property &lt;/script&gt; In the master page…
  • 20. Master Pages - Nesting Master Page IDF (idf.master) Master Page IDF North (idfnorth.master) Master Page IDF South (idfsouth.master) Content page1 (default.aspx) Content Page2 (default2.aspx) Content Page3 (default3.aspx) Content Page4 (default4.aspx)
  • 21. Master Pages – Nesting (cont.) <ul><li>Master pages that have masters must contain only Content controls, but Content controls can contain ContentPlaceHolders </li></ul>&lt;!-- Orders.Master --&gt; &lt;%@ Master MasterPageFile=&amp;quot;~/Site.Master&amp;quot; %&gt; &lt;asp:Content ContentPlaceHolderID=&amp;quot;...&amp;quot; RunAt=&amp;quot;server&amp;quot;&gt; &lt;asp:ContentPlaceHolder ID=&amp;quot;...&amp;quot; RunAt=&amp;quot;server&amp;quot;&gt; ... &lt;/asp:ContentPlaceHolder&gt; &lt;asp:Content&gt;
  • 22. Master Pages - Container-Specific <ul><li>&lt;%@ Page Language=”VB” MasterPageFile=”~/Sela.master” </li></ul><ul><li>Mozilla:MasterPageFile=”~/SelaMozilla.master” </li></ul><ul><li>Opera:MasterPageFile=”~/SelaOpera.master” %&gt; </li></ul><ul><li>&lt;asp:Content ID=”Content1” ContentPlaceHolderId=”ContentPlaceHolder1” </li></ul><ul><li>Runat=”server”&gt; </li></ul><ul><li>Hello World </li></ul><ul><li>&lt;/asp:Content&gt; </li></ul>
  • 23. Master Pages – Event order <ul><li>Master page child controls initialization </li></ul><ul><li>Content page child controls initialization </li></ul><ul><li>Master page initialization </li></ul><ul><li>Content page initialization </li></ul><ul><li>Content page load </li></ul><ul><li>Master page load </li></ul><ul><li>Master page child controls loadContent page child controls load </li></ul>
  • 24. Personalization
  • 25. Personalization - Overview <ul><li>Automatic association between the end user viewing the page and any data points stored for that user. </li></ul><ul><li>The personalization properties that are maintained on a per-user basis are stored on the server and not on the client. </li></ul><ul><li>The end user can access these personalization properties on later site visits. </li></ul><ul><li>Ideal way to start creating highly customizable and user-specific sites without massing with all the underlined code. </li></ul>
  • 26. Personalization – Defining &amp; Using <ul><li>&lt;configuration&gt; </li></ul><ul><ul><li>&lt;system.web&gt; </li></ul></ul><ul><ul><li>&lt;profile&gt; </li></ul></ul><ul><ul><li>&lt;properties&gt; </li></ul></ul><ul><li>&lt;add name=”FirstName” /&gt; </li></ul><ul><li>&lt;add name=”LastName” /&gt; </li></ul><ul><li>&lt;/properties&gt; </li></ul><ul><li> &lt;/profile&gt; </li></ul><ul><li>&lt;/system.web&gt; </li></ul><ul><li>&lt;/configuration&gt; </li></ul>Profile.FirstName = TextBox1.Text Configuration Using
  • 27. Personalization - Groups &lt;group name=”MemberDetails”&gt; &lt;add name=”Member” /&gt; &lt;add name=”DateJoined” /&gt; &lt;add name=”PaidDuesStatus” /&gt; &lt;add name=”Location” /&gt; &lt;/group&gt; Label1.Text = Profile.MemberDetails.DateJoined Configuration Using
  • 28. Personalization - Types <ul><li>Define types to the fields </li></ul><ul><li>Use default values to the fields </li></ul><ul><li>Define readonly for fields </li></ul><ul><li>Create custom types for fields and serialization type. </li></ul>&lt;add name=”Field name” type=”FieldType” serializeAs=”Binary” /&gt;
  • 29. Web Parts
  • 30. Web Parts <ul><li>Orchestrates operation of Web Parts </li></ul><ul><ul><li>Maintains list of Web Parts and zones </li></ul></ul><ul><ul><li>Manages page state (e.g., display mode) and fires events when page state changes </li></ul></ul><ul><ul><li>Facilitates communication between Web Parts </li></ul></ul><ul><ul><li>Manages personalization and much more </li></ul></ul><ul><li>One instance per page; not a visible control. </li></ul>&lt;asp:WebPartManager ID=&amp;quot;WebPartManager1&amp;quot; RunAt=&amp;quot;server&amp;quot; /&gt;
  • 31. Web Parts - WebPartZone <ul><li>Defines zones on a Web Parts page </li></ul><ul><li>Defines default layout and appearance of Web Parts within each zone </li></ul>&lt;asp:WebPartZone ID=&amp;quot;WeatherZone&amp;quot; DragHighlightColor=&amp;quot;244,198,96&amp;quot; RunAt=&amp;quot;server&amp;quot; &gt; &lt;PartTitleStyle BackColor=&amp;quot;#2254B1&amp;quot; ForeColor=&amp;quot;White&amp;quot; /&gt; &lt;PartStyle BorderColor=&amp;quot;#81AAF2&amp;quot; BorderStyle=&amp;quot;Solid&amp;quot; BorderWidth=&amp;quot;1px&amp;quot; /&gt; &lt;ZoneTemplate&gt; &lt;!-- Web Parts declared here --&gt; &lt;/ZoneTemplate&gt; &lt;/asp:WebPartZone&gt;
  • 32. Web Parts - Controls <ul><li>Controls defined in a WebPartZone </li></ul><ul><ul><li>Web controls, user controls, custom controls </li></ul></ul><ul><li>Controls that don&apos;t implement IWebPart are internally wrapped in GenericWebParts </li></ul><ul><ul><li>Adds properties: Title, Description, etc. </li></ul></ul>&lt;ZoneTemplate&gt; &lt;asp:Calendar Title=&amp;quot;Calendar&amp;quot; ID=&amp;quot;Calendar1&amp;quot; RunAt=&amp;quot;server&amp;quot; /&gt; &lt;user:Weather Title=&amp;quot;Weather&amp;quot; ID=&amp;quot;Weather1&amp;quot; RunAt=&amp;quot;server&amp;quot; /&gt; &lt;custom:Search Title=&amp;quot;Search&amp;quot; ID=&amp;quot;Search1&amp;quot; RunAt=&amp;quot;server&amp;quot; /&gt; &lt;/ZoneTemplate&gt;
  • 33. Web Parts – WebPartManager &amp; WebPartPage Menu <ul><li>Gets and sets the page&apos;s display mode </li></ul>Value Description BrowserDisplayMode &amp;quot;Normal&amp;quot; display mode; no editing (default) EditDisplayMode Permits editing of Web Parts&apos; appearance and behavior DesignDisplayMode Permits drag-and-drop layout editing CatalogDisplayMode Permits Web Parts to be added to the page ConnectDisplayMode Permits connections to be established between Web parts &lt;asp:WebPartPageMenu ID=”Webpartpagemenu1” Runat=”server”&gt; &lt;/asp:WebPartPageMenu&gt;
  • 34. Web Parts – Catalog Zone &lt;asp:CatalogZone ID=&amp;quot;CatalogZone1&amp;quot; Runat=&amp;quot;server&amp;quot;&gt; &lt;ZoneTemplate&gt; &lt;asp:PageCatalogPart ID=&amp;quot;PageCatalogPart1&amp;quot; Runat=&amp;quot;server&amp;quot; /&gt; &lt;asp:DeclarativeCatalogPart ID=&amp;quot;DeclarativeCatalogPart1&amp;quot; Runat=&amp;quot;server&amp;quot;&gt; &lt;WebPartsTemplate&gt; &lt;!-- Declarative Web Parts go here --&gt; &lt;/WebPartsTemplate&gt; &lt;/asp:DeclarativeCatalogPart&gt; &lt;asp:ImportCatalogPart ID=&amp;quot;ImportCatalogPart1&amp;quot; Runat=&amp;quot;server&amp;quot; /&gt; &lt;/ZoneTemplate&gt; &lt;/asp:CatalogZone&gt; DeclarativeCatalogPart
  • 35. Web Parts - EditorZone &lt;asp:EditorZone ID=&amp;quot;EditorZone1&amp;quot; Runat=&amp;quot;server&amp;quot;&gt; &lt;ZoneTemplate&gt; &lt;asp:AppearanceEditorPart ID=&amp;quot;AppearanceEditorPart1&amp;quot; Runat=&amp;quot;server&amp;quot; /&gt; &lt;asp:BehaviorEditorPart ID=&amp;quot;BehaviorEditorPart1&amp;quot; Runat=&amp;quot;server&amp;quot; /&gt; &lt;asp:LayoutEditorPart ID=&amp;quot;LayoutEditorPart1&amp;quot; Runat=&amp;quot;server&amp;quot; /&gt; &lt;/ZoneTemplate&gt; &lt;/asp:EditorZone&gt;
  • 36. Web Parts – Custom Web Parts <ul><li>Any control can serve as a Web Part, but… </li></ul><ul><li>Controls that derive from WebPart can better leverage the Web Parts infrastructure </li></ul><ul><ul><li>Control Title and other UI-related properties </li></ul></ul><ul><ul><li>Control AllowClose, AllowZoneChange, AllowMinimize, and other behavioral properties </li></ul></ul><ul><ul><li>Apply role-based security (authorization filters) </li></ul></ul><ul><ul><li>Add custom verbs, export Web Parts, and more </li></ul></ul>
  • 37. Web Parts – Custom Web Parts (cont.) public class MyWebPart : WebPart { public override WebPartVerbCollection Verbs { get { EnsureChildControls (); WebPartVerb verb = new WebPartVerb (new WebPartEventHandler (OnClearResults)); verb.Text = &amp;quot;Clear Results&amp;quot;; WebPartVerb[] verbs = new WebPartVerb[] { verb }; return new WebPartVerbCollection (base.Verbs, verbs); } } void OnClearResults (object sender, WebPartEventArgs args) { ... } ... }
  • 38. Skins And Themes
  • 39. Skins and Themes - Overview <ul><li>Mechanism for theming controls, pages, and sites by group-initializing control properties </li></ul><ul><li>Skin = Visual attributes for control(s) </li></ul><ul><ul><li>Physically stored in .skin files </li></ul></ul><ul><ul><li>Default skins and named skins </li></ul></ul><ul><li>Theme = Collection of one or more skins </li></ul><ul><ul><li>Physically stored in Themes subfolders </li></ul></ul><ul><ul><li>Global themes and local themes </li></ul></ul>
  • 40. Skins and Themes - Applying &lt;%@ Page Theme=&amp;quot;BasicBlue&amp;quot;&gt; &lt;configuration&gt; &lt;system.web&gt; &lt;pages theme=&amp;quot;BasicBlue&amp;quot; /&gt; &lt;/system.web&gt; &lt;/configuration&gt; Sub Page_PreInit (ByVal sender As Object, ByVal e As EventArgs) Page.Theme = &amp;quot;BasicBlue&amp;quot; End Sub On a page On a Site Programmatically
  • 41. Skins And Themes – Global Themes BasicBlue Smoke-AndGlass SKIN SKIN SKIN SKIN ASP.NET-ClientFiles Theme name = Subdirectory name
  • 42. Skins and Themes - Local Themes Shocking-Pink Autumn-Leaves SKIN SKIN SKIN SKIN vroot Theme name = Subdirectory name
  • 43. Skins and Themes – Named Skins <ul><li>Skins without SkinIDs are default skins </li></ul><ul><li>Skins with SkinIDs are named skins </li></ul><ul><ul><li>SkinIDs must be unique per control type </li></ul></ul><ul><ul><li>Can be defined in same SKIN file as default skins or in separate files </li></ul></ul><ul><li>Use controls&apos; SkinID properties to apply named skins </li></ul>
  • 44. Skins and Thems – Named Skins (Defining and Using) &lt;!-- Default look for DropDownList controls --&gt; &lt;asp:DropDownList runat=&amp;quot;server&amp;quot; BackColor=&amp;quot;blue&amp;quot; ForeColor=&amp;quot;white&amp;quot; SkinID=&amp;quot;Blue&amp;quot; /&gt; &lt;!-- Default look for DataGrid conotrols --&gt; &lt;asp:DataGrid runat=&amp;quot;server&amp;quot; BackColor=&amp;quot;#CCCCCC&amp;quot; BorderWidth=&amp;quot;2pt&amp;quot; BorderStyle=&amp;quot;Solid&amp;quot; BorderColor=&amp;quot;#CCCCCC&amp;quot; GridLines=&amp;quot;Vertical&amp;quot; HorizontalAlign=&amp;quot;Left&amp;quot; SkinID=&amp;quot;Blue&amp;quot;&gt; &lt;HeaderStyle ForeColor=&amp;quot;white&amp;quot; BackColor=&amp;quot;blue&amp;quot; /&gt; &lt;ItemStyle ForeColor=&amp;quot;black&amp;quot; BackColor=&amp;quot;white&amp;quot; /&gt; &lt;AlternatingItemStyle BackColor=&amp;quot;lightblue&amp;quot; ForeColor=&amp;quot;black&amp;quot; /&gt; &lt;/asp:DataGrid&gt; ... &lt;asp:DropDownList ID=&amp;quot;Countries&amp;quot; SkinID=&amp;quot;Blue&amp;quot; RunAt=&amp;quot;server&amp;quot; /&gt;
  • 45. Administration &amp; Management
  • 46. A&amp;M - Overview <ul><li>Administrative tools </li></ul><ul><ul><li>ASP.NET MMC snap-in </li></ul></ul><ul><ul><li>Web Site Administration Tool (Webadmin.axd) </li></ul></ul><ul><li>Configuration API </li></ul><ul><ul><li>Read/write access to configuration settings </li></ul></ul><ul><ul><li>Simplified custom configuration sections </li></ul></ul><ul><li>Instrumentation </li></ul><ul><ul><li>Perf counters, health monitoring, and more </li></ul></ul>
  • 47. A&amp;M – ASP.NET MMC Snap-In <ul><li>GUI for applying configuration settings </li></ul>
  • 48. A&amp;M – Web Site Administration Tool (WAT) <ul><li>Browser-based admin GUI </li></ul>Invoked by requesting Webadmin.axd or using the &amp;quot;ASP.NET Configuration&amp;quot; command in Visual Studio&apos;s Website menu
  • 49. A&amp;M – Configuration class <ul><li>Gateway to the configuration API </li></ul><ul><li>Provides merged view of configuration settings for machine or application </li></ul><ul><li>AppSettings and ConnectionStrings properties provide access to &lt;appSettings&gt; and &lt;connectionStrings&gt; sections </li></ul><ul><li>Sections and SectionGroups properties provide access to all other sections </li></ul>
  • 50. A&amp;M – Configuration Class Methods Name Description GetExeConfiguration Returns a Configuration object representing config settings for a managed EXE GetMachineConfiguration Returns a Configuration object representing configuration settings for the specified server GetWebConfiguration Returns a Configuration object representing configuration settings for the specified Web application GetSectionGroup Returns a ConfigurationSectionGroup object representing the specified section group Update Records changes in the relevant configuration file GetSection Returns a ConfigurationSection object representing the specified section (e.g., &lt;appSettings&gt;
  • 51. A&amp;M – Configuration class properties Name Description AppSettings Returns an AppSettingsSection object representing the &lt;appSettings&gt; section ConnectionStrings Returns a ConnectionStringsSection object representing the &lt;connectionsStrings&gt; section HasFile True if there&apos;s a corresponding configuration file, false if not SectionGroups Returns a ConfigurationSectionGroupCollection representing all section groups Sections Returns a ConfigurationSectionCollection representing all sections Path Path to the app represented by this Configuration object
  • 52. A&amp;M – Configuration example (Reading Connection String) ‘ Read a connection string from &lt;connectionStrings&gt; Dim connect As string = ConfigurationSettings.ConnectionStrings(&amp;quot;Northwind“).ConnectionString ‘ Add a connection string to &lt;connectionStrings&gt; Dim config As Configuration = Configuration.GetWebConfiguration (Request.ApplicationPath) config.ConnectionStrings.ConnectionStrings.Add (new ConnectionStringSettings (&amp;quot;Northwind&amp;quot;, &amp;quot;server=localhost;database=northwind;integrated security=true&amp;quot;) config.Update () // Important!
  • 53. A&amp;M – ASP.NET Instrumentation Name Description Performance counters New peformance counters supplement the ones introduced in ASP.NET 1.x Windows event tracing Integration with ETW subsystem to support low-overhead tracing of HTTP requests through the system Application tracing ASP.NET trace facility upgraded with new features and to allow coupling to System.Diagnostics.Trace Health monitoring New provider-based subsystem for logging notable events (&amp;quot;Web events&amp;quot;) that occur during an application&apos;s lifetime
  • 54. Handling Data
  • 55. Handling Data – DataSource control <ul><li>SqlDataSource </li></ul><ul><ul><li>Enables you to work with any SQL-based database, such as Microsoft SQL Server or Oracle. </li></ul></ul><ul><li>AccessDataSource </li></ul><ul><ul><li>Enables you to work with a Microsoft Access file (.mbd). </li></ul></ul><ul><li>ObjectDataSource </li></ul><ul><ul><li>Enables you to work with a business object or a Visual Studio 2005 data component. </li></ul></ul><ul><li>XmlDataSource </li></ul><ul><ul><li>Enables you to work with the information from an XML file or an XML source (for example an RSS feed). </li></ul></ul><ul><li>SiteMapDataSource </li></ul><ul><ul><li>Enables you to work with the hierarchical data represented in the site map file (.sitemap). </li></ul></ul><ul><li>DataSetDataSource </li></ul><ul><ul><li>Enables you to work with data that is represented in a DataSet object . </li></ul></ul>
  • 56. Handling Data – Data Bound Server controls <ul><li>&lt;asp:GridView&gt; </li></ul><ul><li>&lt;asp:DataGrid&gt; </li></ul><ul><li>&lt;asp:DetailsView&gt; </li></ul><ul><li>&lt;asp:TreeView&gt; </li></ul><ul><li>&lt;asp:Menu&gt; </li></ul><ul><li>&lt;asp:DataList&gt; </li></ul><ul><li>&lt;asp:Repeater&gt; </li></ul><ul><li>&lt;asp:DropDownList&gt; </li></ul><ul><li>&lt;asp:BulletedList&gt; </li></ul><ul><li>&lt;asp:CheckBoxList&gt; </li></ul><ul><li>&lt;asp:RadioButtonList&gt; </li></ul><ul><li>&lt;asp:ListBox&gt; </li></ul><ul><li>&lt;asp:AdRotator&gt; </li></ul>
  • 57. Site Navigation
  • 58. Site Navigation - Overview <ul><li>Navigation UIs are tedious to implement </li></ul><ul><ul><li>Especially if they rely on client-side script </li></ul></ul><ul><li>New controls simplify site navigation </li></ul><ul><ul><li>TreeView and Menu - Navigation UI </li></ul></ul><ul><ul><li>SiteMapDataSource - XML site maps </li></ul></ul><ul><ul><li>SiteMapPath - &amp;quot;Bread crumb&amp;quot; controls </li></ul></ul><ul><li>Public API provides foundation for controls </li></ul><ul><li>Provider-based for flexibility </li></ul>
  • 59. Site Navigation - Schema Site Navigation API Site Maps Web.sitemap Other Data Stores Controls Menu TreeView SiteMapPath SiteMap- DataSource SiteMap SiteMapNode SiteMapNode SiteMapNode XmlSiteMapProvider Other Site Map Providers Providers
  • 60. Site Navigation – TreeView Example &lt;asp:TreeView ShowLines=&amp;quot;true&amp;quot; Font-Name=&amp;quot;Verdana&amp;quot; Font-Size=&amp;quot;10pt&amp;quot; ... &gt; &lt;SelectedNodeStyle BackColor=&amp;quot;Yellow&amp;quot; /&gt; &lt;HoverNodeStyle BackColor=&amp;quot;LightBlue&amp;quot; /&gt; &lt;Nodes&gt; &lt;asp:TreeNode Text=&amp;quot;Not selectable&amp;quot; SelectAction=&amp;quot;None&amp;quot; RunAt=&amp;quot;server&amp;quot;&gt; &lt;asp:TreeNode Text=&amp;quot;Selectable&amp;quot; SelectAction=&amp;quot;Select&amp;quot; RunAt=&amp;quot;server&amp;quot; &gt; &lt;asp:TreeNode Text=&amp;quot;Click to expand or collapse&amp;quot; SelectAction=&amp;quot;Expand&amp;quot; Runat=&amp;quot;server&amp;quot;&gt; &lt;asp:TreeNode Text=&amp;quot;Click to select and expand or collapse&amp;quot; SelectAction=&amp;quot;SelectExpand&amp;quot; Runat=&amp;quot;server&amp;quot;&gt; &lt;asp:TreeNode Text=&amp;quot;Check box node&amp;quot; ShowCheckBox=&amp;quot;true&amp;quot; Runat=&amp;quot;server&amp;quot;&gt; &lt;asp:TreeNode Text=&amp;quot;Click to navigate&amp;quot; NavigateUrl=&amp;quot;...&amp;quot; Runat=&amp;quot;server&amp;quot; /&gt; &lt;/asp:TreeNode&gt; &lt;/asp:TreeNode&gt; &lt;/asp:TreeNode&gt; &lt;/asp:TreeNode&gt; &lt;/asp:TreeNode&gt; &lt;/Nodes&gt; &lt;/asp:TreeView&gt;
  • 61. Site Navigation – Menu Control &lt;asp:Menu Orientation=&amp;quot;Horizontal&amp;quot; RunAt=&amp;quot;server&amp;quot;&gt; &lt;Items&gt; &lt;asp:MenuItem Text=&amp;quot;Training&amp;quot; RunAt=&amp;quot;server&amp;quot;&gt; &lt;asp:MenuItem Text=&amp;quot;Programming .NET&amp;quot; RunAt=&amp;quot;server&amp;quot; Navigateurl=&amp;quot;Classes.aspx?id=1&amp;quot; /&gt; &lt;asp:MenuItem Text=&amp;quot;Programming ASP.NET&amp;quot; RunAt=&amp;quot;server&amp;quot; NavigateUrl=&amp;quot;Classes.aspx?id=2&amp;quot; /&gt; &lt;asp:MenuItem Text=&amp;quot;Programming Web Services&amp;quot; RunAt=&amp;quot;server&amp;quot; NavigateUrl=&amp;quot;Classes.aspx?id=3&amp;quot; /&gt; &lt;/asp:MenuItem&gt; &lt;asp:MenuItem Text=&amp;quot;Consulting&amp;quot; RunAt=&amp;quot;server&amp;quot; NavigateUrl=&amp;quot;Consulting.aspx&amp;quot; /&gt; &lt;asp:MenuItem Text=&amp;quot;Debugging&amp;quot; RunAt=&amp;quot;server&amp;quot; NavigateUrl=&amp;quot;Debugging.aspx&amp;quot; /&gt; &lt;/Items&gt; &lt;/asp:Menu&gt;
  • 62. Site Navagation - SiteMap &lt;siteMap&gt; &lt;siteMapNode title=&amp;quot;Home&amp;quot; description=&amp;quot;&amp;quot; url=&amp;quot;default.aspx&amp;quot;&gt; &lt;siteMapNode title=&amp;quot;Training&amp;quot; url=&amp;quot;Training.aspx&amp;quot; description=&amp;quot;Training for .NET developers&amp;quot;&gt; &lt;siteMapNode title=&amp;quot;Programming .NET&amp;quot; url=&amp;quot;Classes.aspx?id=1&amp;quot; description=&amp;quot;All about the .NET Framework&amp;quot; /&gt; &lt;siteMapNode title=&amp;quot;Programming ASP.NET&amp;quot; url=&amp;quot;Classes.aspx?id=2&amp;quot; description=&amp;quot;All about ASP.NET&amp;quot; /&gt; &lt;siteMapNode title=&amp;quot;Programming Web Services&amp;quot; url=&amp;quot;Classes.aspx?id=3&amp;quot; description=&amp;quot;All about Web services&amp;quot; /&gt; &lt;/siteMapNode&gt; &lt;siteMapNode title=&amp;quot;Consulting&amp;quot; url=&amp;quot;Consulting.aspx&amp;quot; description=&amp;quot;Consulting for .NET projects&amp;quot; /&gt; &lt;siteMapNode title=&amp;quot;Debugging&amp;quot; url=&amp;quot;Debugging.aspx&amp;quot; description=&amp;quot;Help when you need it the most&amp;quot; /&gt; &lt;/siteMapNode&gt; &lt;/siteMap&gt;
  • 63. Site Navigation – TreeView and SiteMap &lt;siteMap&gt; &lt;siteMapNode title=&amp;quot;Home&amp;quot; description=&amp;quot;&amp;quot; url=&amp;quot;default.aspx&amp;quot;&gt; &lt;siteMapNode title=&amp;quot;Training&amp;quot; url=&amp;quot;Training.aspx&amp;quot; description=&amp;quot;Training for .NET developers&amp;quot;&gt; &lt;siteMapNode title=&amp;quot;Programming .NET&amp;quot; url=&amp;quot;Classes.aspx?id=1&amp;quot; description=&amp;quot;All about the .NET Framework&amp;quot; /&gt; &lt;siteMapNode title=&amp;quot;Programming ASP.NET&amp;quot; url=&amp;quot;Classes.aspx?id=2&amp;quot; description=&amp;quot;All about ASP.NET&amp;quot; /&gt; &lt;siteMapNode title=&amp;quot;Programming Web Services&amp;quot; url=&amp;quot;Classes.aspx?id=3&amp;quot; description=&amp;quot;All about Web services&amp;quot; /&gt; &lt;/siteMapNode&gt; &lt;siteMapNode title=&amp;quot;Consulting&amp;quot; url=&amp;quot;Consulting.aspx&amp;quot; description=&amp;quot;Consulting for .NET projects&amp;quot; /&gt; &lt;siteMapNode title=&amp;quot;Debugging&amp;quot; url=&amp;quot;Debugging.aspx&amp;quot; description=&amp;quot;Help when you need it the most&amp;quot; /&gt; &lt;/siteMapNode&gt; &lt;/siteMap&gt; Web.sitemap &lt;asp:SiteMapDataSource ID=&amp;quot;SiteMap&amp;quot; RunAt=&amp;quot;server&amp;quot; /&gt; &lt;asp:TreeView DataSourceID=&amp;quot;SiteMap&amp;quot; RunAt=&amp;quot;server&amp;quot; /&gt;
  • 64. Site Navigation – Menu and SiteMap &lt;asp:SiteMapDataSource ID=&amp;quot;SiteMap&amp;quot; RunAt=&amp;quot;server&amp;quot; /&gt; &lt;asp:Menu DataSourceID=&amp;quot;SiteMap&amp;quot; RunAt=&amp;quot;server&amp;quot; /&gt; &lt;siteMap&gt; &lt;siteMapNode title=&amp;quot;Home&amp;quot; description=&amp;quot;&amp;quot; url=&amp;quot;default.aspx&amp;quot;&gt; &lt;siteMapNode title=&amp;quot;Training&amp;quot; url=&amp;quot;Training.aspx&amp;quot; description=&amp;quot;Training for .NET developers&amp;quot;&gt; &lt;siteMapNode title=&amp;quot;Programming .NET&amp;quot; url=&amp;quot;Classes.aspx?id=1&amp;quot; description=&amp;quot;All about the .NET Framework&amp;quot; /&gt; &lt;siteMapNode title=&amp;quot;Programming ASP.NET&amp;quot; url=&amp;quot;Classes.aspx?id=2&amp;quot; description=&amp;quot;All about ASP.NET&amp;quot; /&gt; &lt;siteMapNode title=&amp;quot;Programming Web Services&amp;quot; url=&amp;quot;Classes.aspx?id=3&amp;quot; description=&amp;quot;All about Web services&amp;quot; /&gt; &lt;/siteMapNode&gt; &lt;siteMapNode title=&amp;quot;Consulting&amp;quot; url=&amp;quot;Consulting.aspx&amp;quot; description=&amp;quot;Consulting for .NET projects&amp;quot; /&gt; &lt;siteMapNode title=&amp;quot;Debugging&amp;quot; url=&amp;quot;Debugging.aspx&amp;quot; description=&amp;quot;Help when you need it the most&amp;quot; /&gt; &lt;/siteMapNode&gt; &lt;/siteMap&gt; Web.sitemap
  • 65. Site Navigation – SiteMap API Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Hyperlink1.Text = SiteMap.CurrentNode.ParentNode.ToString() Hyperlink1.NavigateUrl = SiteMap.CurrentNode.ParentNode.Url Hyperlink2.Text = SiteMap.CurrentNode.PreviousSibling.ToString() Hyperlink2.NavigateUrl = SiteMap.CurrentNode.PreviousSibling.Url Hyperlink3.Text = SiteMap.CurrentNode.NextSibling.ToString() Hyperlink3.NavigateUrl = SiteMap.CurrentNode.NextSibling.Url End Sub &lt;html xmlns=”http://www.w3.org/1999/xhtml” &gt; &lt;head runat=”server”&gt; &lt;title&gt;SiteMapDataSource&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id=”form1” runat=”server”&gt; Move Up: &lt;asp:Hyperlink ID=”Hyperlink1” Runat=”server”&gt;&lt;/asp:Hyperlink&gt;&lt;br /&gt; &lt;-- &lt;asp:Hyperlink ID=”Hyperlink2” Runat=”server”&gt;&lt;/asp:Hyperlink&gt; | &lt;asp:Hyperlink ID=”Hyperlink3” Runat=”server”&gt;&lt;/asp:Hyperlink&gt; --&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt;
  • 66. Summary – ASAP.Net <ul><li>New features to simplify repetitive coding tasks </li></ul><ul><li>New provider model offers extra extensibility </li></ul><ul><li>New compilation model fixes old base/derived class problem </li></ul><ul><li>It’s stronger, faster, prettier and with a better engine. Wouldn’t you like to give it a test drive ? </li></ul>

×