asp.net 4.0 [email protected] web developers user group israel june 2009

38
ASP.NET 4.0 ASP.NET 4.0 [email protected] Web Developers User Group Israel June 2009

Upload: sydney-scott

Post on 24-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

ASP.NET 4.0ASP.NET 4.0

[email protected]

Web Developers User Group

Israel June 2009

Overview of TalkOverview of Talk

ASP.NET supports several very different types of web applications

ASP.NET 3.5 Service Pack ASP.NET 3.5 Service Pack 11

Microsoft Entity FrameworkADO.NET Data ServicesDynamic DataMicrosoft AJAX Improvements

Browser HistoryScript Combining

ASP.NET CoreASP.NET Core

AppDomainAppDomain

PoolPool

HttpApplicationFactory

HttpApplicationFactory

HttpRuntimeHttpRuntimeHttpApplicatio

nHttpApplicatio

nHttpApplication

HttpApplicationHttpApplication

HttpApplicationHttpApplication

HttpApplication

Request from hostRequest from host

HttpContextHttpContext

HttpApplication

HttpApplicationHttpApplication

HttpApplication

HttpContextHttpContext

ASP.NET RuntimeASP.NET Runtime

Http HandlerHttp Handler

HttpApplicationHttpApplication

BeginRequest()

AuthenticateRequest()

AuthorizeRequest()

ResolveRequestCache()

AcquireRequestState()

PreRequestHandlerExecute()

EndRequest()

UpdateRequestCache()

ReleaseRequestState()

PostRequestHandlerExecute()

HttpModuleHttpModuleHttpModuleHttpModuleHttpModuleHttpModuleHttpModuleHttpModuleHttpModuleHttpModuleHttpModuleHttpModuleHttpModuleHttpModuleHttpModuleHttpModule

IHttpHandlerIHttpHandler

Init

IHttpHandlerFactory

IHttpHandlerFactory

ASP.NET Core EnhancementsASP.NET Core Enhancements

Cache Extensibility

Auto-Start Web Applications

Browser Capabilities Extensibility

Session State Compression

Output Cache ExtensibilityOutput Cache Extensibility

Store generated output of aspx/ascxHttp.sys IntegrationHttpSubstituation CallbackASP.NET 4.0

OutputCacheProviderFuture – Cache API ExtensibilityProviders for 3rd Party, Velocity, FileSystem

Auto-Start Web Auto-Start Web ApplicationsApplications

Usual approach: Application_StartAuto-Start

ASP.NET 4.0 + IIS 7.5IProcessHostPreloadClientAppPool startMode set to “alwaysRunning”

Browser CapabilitiesBrowser Capabilities

ASP.NET Determines Browser CapabilitiesConfig\Browser Directory

Create or Update and XML fileAspnet_regbrowsers

BrowserCapabilitiesCodeGenerator  ASP.NET 4.0 - HttpCapabilitiesProvider

Session State CompressionSession State Compression

CPU IntensiveUsed when state is out of porcesscompressionEnabled in web.configDeflateStream/GZipStream

Useful in the ASP.NET world anyway..

ASP.NET Web FormsASP.NET Web Forms

ASP.NET Web FormsASP.NET Web Forms

With ASP.NET 4.0, you are in control:Control RenderingControl IDsView StateWebsite URLsXHTML and Accessibility

Code SnippetsCode Snippets

HTMLdiv, table, img …

ASP.NETscriptmanager, sqldatasource, formview …

ASP.NET AJAXbehavior, control …

JScriptfunction, forin …

FormView ImprovementsFormView Improvements

<asp:FormView ID="Formview1"

RenderTable="false" runat="server">

ListView ImprovementsListView Improvements

Control Your View StateControl Your View State

New Property - Control.ViewStateMode

EnabledDisabledInherit (default)

Also applicable on the Page level in the futureDifferent than EnableViewState Control State persists anyway

Control Your Client IDsControl Your Client IDs

Control.ClientIdModeLegacyStaticPredictableInherit (default)

$get(<%= Server Side %>) vs alternatives

Control Your Client IDsControl Your Client IDs

<system.web> <pages clientIdMode="Predictable"> </pages></system.web>

ASP.NET RoutingASP.NET Routing

.NET 3.5 SP1http://YourSite.com/search/Sharepoint

http://YourSite.com/Search.aspx?query=SharepointaDefined in Global.asax via RouteTableAccess via Page.RouteDataExpressionBuilders

RouteUrlRouteValue

RouteParameter

Other Search Engine Other Search Engine Optimization ImprovementsOptimization Improvements

Page.DescriptionPage.KeywordsResponse.RedirectPermanent(new url)SEO Toolkit for IIS 7.0

QueryExtender ControlQueryExtender Control

Works with EntityDataSource and LinqDataSourceEnables you to filter database resultsAccepts different types of expressions:

Search RangePropertyCustom

ASP.NET AJAXASP.NET AJAX

ASP.NET AJAXASP.NET AJAX

ASP.NET AJAXASP.NET AJAX

Client-Side TemplatesClient-Side ControlsClient-Side Data BindingRead/Write Database Data from the BrowserCross-Browser CompatibleNot tied to ASP.NET

Client Side TemplatesClient Side Templates

Client templates replicate HTMLXHTML compliant (use namespace extensions)Placeholder notation similar to Silverlight/WPF

{{ Name }}

Interspersed code and markupDeclarative behavior and events

Customizing TemplatesCustomizing Templates

Expression language is JavaScript {{BirthDate.localeFormat("dd/MM/yyyy")}}Can leverage pseudo columns and interspersed code and markupcode:ifcode:beforecode:after$index$dataItem

Live BindingLive Binding

Live BindingsReflect changes live from data

<span>{binding Name}</span><input value="{binding Name}" />

Reflect changes live back to data from user input

No round-trip to server

Convert and ConvertBack functions

ASP.NET AJAXASP.NET AJAXRefactored Microsoft AJAX Library

MicrosoftAjaxCore.jsMicrosoftAjaxComponentModel.jsMicrosoftAjaxSerialization.jsMicrosoftAjaxGlobalization.jsMicrosoftAjaxHistory.jsMicrosoftAjaxNetwork.jsMicrosoftAjaxWebServices.jsMicrosoftAjaxApplicationServices.j

sMicrosoftAjaxTemplates.js (New )MicrosoftAjaxAdoNet.js (New)

ASP.NET AJAXASP.NET AJAXCreated by John ResigOpen SourceMicrosoft Product supportjQuery Intellisense

Supported in Visual Studio 2008Supported in Visual Studio 2010

ASP.NET MVCASP.NET MVC

ASP.NET MVCASP.NET MVC

Enables a clear separation of concernsEnables testability including test-driven developmentEnables fine-grained control over HTML and JavaScriptASP.NET 4.0

Asynchrnous controllersDeclarative ControlsAjax support (+partial rendering)

ASP.NET Dynamic DataASP.NET Dynamic Data

ASP.NET Dynamic DataASP.NET Dynamic Data

DynamicDataManager ControlDynamicHyperLink ControlField Templates for Email and URLSupport for Inheritance and Many-to-Many RelationshipsEntity Templates

ASP.NET Dynamic DataASP.NET Dynamic Data

Entity Templates

ConclusionConclusion

ASP.NET supports several very different types of web applications

ResourcesResources

• ASP.NET 4.0 and Visual Studio 2010 Web Development Overviewhttp://www.asp.net/learn/whitepapers/

• CodePlex ASP.NET Previewshttp://www.CodePlex.com/AspNet

ASP.NET 4.0ASP.NET 4.0

[email protected]