ASP.NET 4.0
Upcoming SlideShare
Loading in...5
×
 

ASP.NET 4.0

on

  • 2,490 views

 

Statistics

Views

Total Views
2,490
Views on SlideShare
2,469
Embed Views
21

Actions

Likes
0
Downloads
45
Comments
1

3 Embeds 21

http://www.xedotnet.org 17
http://www.slideshare.net 3
http://xedotnet.org 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • thanks
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

ASP.NET 4.0 ASP.NET 4.0 Presentation Transcript

  • ASP.net 4.0 WebForm and Core Runtime
    Le novità per lo sviluppo web(Form) e del runtime
    Andrea Colaci
  • ASP.net 4.0 WebForm
    New project templates, snippets, deployment
    Controls (ClientId, ViewState)
    Routing
    Deployment
    ASP.net 4.0 Runtime
    appDomain Resource Monitoring «ARM»
    IIS integration: wp auto-start & application warm-up
    Session Activation & Compression
    OutputCache provider extensibility, out-of-proc Cache
    Agenda
  • ASP.net 4.0 WebForm
    Visual Studio 2010
    New project templates, JQuery, snippets
    Server controls enhancements
    New browser-capability files (nuovi devices)
    CheckBoxList, RadioButtonList
    RepeatLayout: UnorderedList, OrderedList, Flow, Table
    ChangePassword, FormView, Login, PasswordRecovery
    RenderOuterTable
    Granular ViewState, ClientId
    Routing in WebForm 4.0
    Deployment
  • Granular ViewState
    @Page EnableViewState=False
    Control1 ViewStateMode=Enabled
  • ClientID
    AutoId: generato automaticamente
    Ctr00_ShopCartExpanded
    Static: impostato manualmente (da markup)
    ShopCartExpanded
    Inherit: stessa modalità controllo parent.
    Predictable: per controlli databound, ClientIdRowSuffix (suffisso = proprietà del DataSource es. ProductId)
    Ctr10_Quantity_775
  • ClientID
    “It is up to you to make sure that the rendered control IDs are unique.
    If they are not, it can break any functionality that requires unique IDs for individual HTML elements, such as the client document.getElementById function.”
    Fonte: ASP.net 4.0 Whitepaper
  • 17/01/2008
    www.xedotnet.org
    7
    VS2010, Granular ViewState, ControlId
    DEMO
  • Routing
    www.mySite.com/BikesCatalog.aspx?Year=2010&CategoryId=79&Page=2
    www.mySite.com/2010/Bikes/OffRoad/2
    • Hackable urls
    • SEO friendly
    • Discaccoppiamento tra url fisico e logico
    • Gestione centralizzata
  • Routing != URL Rewriting
    • ASP.Net UrlMappings (dalla 2.0)
    • Riscrive l’url prima che la request sia gestita (Module)
    • Sintassi dichiarativa (web.config)
    • Impatto (quasi) zero
    • URLRewriter.net
    • API
    • RegEx per manipolazione Querystring
    • Form proprietario (gestione postback)
  • Routing != URL Rewriting
  • ASP.net 4.0 Routing
    • REST-ful
    • Introdotto in ASP.net 3.5 SP1
    • Evoluto con ASP.net MVC
    • Disponibile a pieno titolo in WebForm 4.0
    • System.Web.Routing
    • UrlRoutingModule
    • RouteTable
    • Expression builders (<%$ ... %>)
    • RouteUrlExpressionBuilder
    • RouteValueExpressionBuilder
  • Routing
    www.mySite.com/Catalog/Bikes
    Request
    RouteTable
    UrlRoutingModule
    IHttpModule
    PageRouteHandler
    PageRouteHandler
    CustomRouteHandler
    Response
    Catalog.aspx IHttpHandler
    ProcessRequest(HttpContext context)
  • 17/01/2008
    www.xedotnet.org
    13
    Routing
    DEMO
  • Deployment
    • Web.config transformations (simile ad EntLib configuration, ma basato XSLT)
    • Web Packages (MSDeploy)
    • IIS Settings, GAC, COM, SQL DB, Security
    • One-click Publishing
    • Sfrutta IIS Remote Management
    • Hosters che supportano One-click (vedi links)
  • Web.config transformations
  • Web deployment
    • Pages
    • Content
    • IIS Settings
    • Database Schema + Data + Custom Scripts
  • 17/01/2008
    www.xedotnet.org
    17
    Web.config transform, one-click deployment
    DEMO
  • 17/01/2008
    www.xedotnet.org
    18
    PaRTE 2: RUNTIME
  • ARM (appDomain resource monitoring)
    Introdotti con in CLR 4
    ASP.net esponeperf. Counters per ogniAppDomain
    • Managed Memory Used
    • % Managed Processor Time
    Deveessereabilitato (è off di default)
    • Aspnet.config (IIS-CLR low level settings)
    • Implica un overhead
    • Campionamentoogni 5 secondi
  • 17/01/2008
    www.xedotnet.org
    20
    ARM AppDomain Resource Monitoring
    DEMO
  • IIS 7.5 integration & warm-up
    IIS 7.5
    • Auto-start worker process
    • Http services
    • Non http services (WCF netTcp, WF)
    • Il team di IIS ha creato un application Warm-up module
    • Sfruttabile da applicazioni ASP.net < 4.0
    • Si integra con applicazioni ASP.net 4.0 (web.config)
    Application Warm-Up
    • Utile in contesti di sincronizzazione di più applicazioni
    • Fornisce un entry point per eseguire codice custom di inizializzazione (no HttpContext)
    • ApplicationHost.config (%windir%system32inetsrvconfig)
    • IProcessHostPreloadClient
  • IProcessHostPreloadClient
    AppPool
    Data Store
    Cache
    Custom Warm-up code IProcessHostPreloadClient
    Request
    Business App
    Request
    Consumer App
    Request
  • Windows Server AppFabric Caching (a.k.a. Velocity)
    Cache distribuita (MemCached, ScaleOut State Server, NCache)
    In-memory, scalabile, fault-tolerant
    Componente di Windows Server 2008
    Server installabile anche su Windows7 e Vista
    H.A. richiede Windows Server 2008 Enterprise
    Parte server richiede .net fx 4.0
    Client library richiede .net fx 3.5 o superiore
    SessionProvider per ASP.net (3.5)
    AppFabric Cache
  • 17/01/2008
    www.xedotnet.org
    24
    IIS 7.5 integration & warm-up
    DEMO
  • Session in ASP.net 4.0
    Automatic compression
    • Si abilita da web.config
    • Solo per i providers out-of-process (StateServer SQLServer)
    • Usa GZipStream
    • Riduzione fino a 2/3 della dimensione iniziale
    • Implica un overhead ad ogni request (tradeoffs?)
    Programmatic activation
    • Abilita/Disabilita l’uso della sessione (per request)
    • HttpModule + SetSessionStateBehavior()
  • 17/01/2008
    www.xedotnet.org
    26
    Session in ASP.net 4.0
    DEMO
  • OutputCache extensibility
    OutputCache (da sempre!)
    • Disponibile per WebForm & MVC (action filters)
    • Aumenta drasticamente le prestazioni
    • Consente di memorizzare la Response di
    • Pagine intere
    • UserControls .ascx (fragment cache)
    Output Cache (da ASP.net 4.0)
    • Disk-based & AppFabric providers (post-RTM)
    • Estendibile/Personalizzabile
    Implementare OutputCacheProvider (abstract class)
    Dichiarare il provider (web.config)
    Override GetOutputCacheProviderName (global.asax)
  • 17/01/2008
    www.xedotnet.org
    28
    OutputCache extensibility
    DEMO
  • Links
    IIS7.5 WarmupModule
    http://www.iis.net/expand/applicationwarmup
    AppFabric
    http://msdn.microsoft.com/en-us/windowsserver/ee695849.aspx
    http://blogs.ugidotnet.org/AndreaCol/category/3613.aspx
    ASP.net 4.0 Routing
    http://www.4guysfromrolla.com/articles/012710-1.aspx
    SmartyRoute - http://bit.ly/PRA6G
    Try ASP.net 4.0 & one-click deploy (free)
    http://labs.discountasp.net/
    http://www.orcsweb.com/hosting/vs2010beta.aspx
    http://aspnet4beta.maximumasp.com/
  • Link
    17/01/2008
    www.xedotnet.org
    30
    Riferimenti
    Blogs.ugidotnet.org/AndreaCol
    Andrea.colaci79@gmail.com
    www.andreacol.net
    AndreaColaci