Download - What’s New in ASP.NET 4
![Page 1: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/1.jpg)
![Page 2: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/2.jpg)
10 % Read
20% Hear
30% See
50% Hear + See
70% Say + Write
90% Experience
You generally remember…
![Page 3: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/3.jpg)
Todd AnglinChief Evangelist, TelerikMicrosoft MVPASPNET InsiderNHDNUG President & O’Reilly Author
@toddanglin
telerikwatch.com
![Page 4: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/4.jpg)
Telerik
One-stop provider for .NET tools & UI components
UI DATA PRODUCTIVITY TESTING TFS CMS
UI: ASP.NET AJAX, MVC, WinForms, Silverlight, WPFDATA: Telerik Reporting, OpenAccess ORMPRODUCTIVITY: JustCodeTESTING: WebUI Test StudioTFS: Work Item Manager, Project DashboardCMS: Sitefinity CMS.NET Developer Productivity
![Page 5: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/5.jpg)
Today’s Road Map
Web Developer Landscape
What’s New Overview
What’s New Demos
Dynamic DatajQuery & MVCWhat’s Next
![Page 6: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/6.jpg)
What are the technologies of the web?
![Page 7: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/7.jpg)
Web Development
CSS
Java Script
HTML
jQuery
![Page 8: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/8.jpg)
Memory Lane
1991
1993
19961998
2002CSSASP 1.0
![Page 9: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/9.jpg)
At the time of ASP.NET 1…
JavaScript was a pain– But, IE6 held 96% browser share
.NET was brand new– WinForms was new, VB6 was popular
Yet to be invented:– AJAX*– jQuery– Web 2.0– Silverlight/XAML– Twitter
![Page 10: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/10.jpg)
Cloud
JSON
REST Web Services
AJAX RIA
WebMatrix
MVC
Video
HTML5
CSS3
Mobile
Browser War IISocial Media
![Page 11: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/11.jpg)
4
![Page 12: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/12.jpg)
What is “ASP.NET”?
![Page 13: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/13.jpg)
Core Services WebForms MVC Dynamic
Data AJAX
ASP.NET
![Page 14: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/14.jpg)
HTML + JS asp.net webforms
On the Metal
Abstracted
asp.net mvc
![Page 15: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/15.jpg)
introduction to asp.net 4.0
putting you in control
ViewState Control IDs Caching
Extensibility Control Rendering URLs
![Page 16: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/16.jpg)
HTML + JS asp.net webforms
On the Metal
Abstracted
asp.net mvc
![Page 17: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/17.jpg)
*important notes– Side-by-side enabled– Backwards & Upwards compatible
• controlRenderingCompatibilityVersion– VS 2010 only
![Page 18: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/18.jpg)
ViewState can be opt-in
ViewStateModeEnabled/Disabled/Inherit
ViewState
![Page 19: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/19.jpg)
4 Mode:– AutoID – Static– Inherit– Predictable (*default)
(+ ClientIDRowSuffix)
Control IDs
<!--Set client ID--><asp:ListView DataSourceID=“odsYourData" ClientIDRowSuffix="ID" ClientIDMode="Predictable"
<!--Global config-><system.web> <pages clientIDMode="Predictable"> </pages> </system.web>
![Page 20: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/20.jpg)
Improved in 4.0
Routing
public class Global : System.Web.HttpApplication{ protected void Application_Start(object sender, EventArgs e) { RouteTable.Routes.Add("Product", new Route("Products/{category}", new PageRouteHandler("~/Products.aspx"))); }}
<asp:Literal Text="<%$ RouteValue:Category %>" runat="server" />
Global.asax
![Page 21: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/21.jpg)
New APIs
Page.MetaDescription = "this is meta description";Page.MetaKeywords = "this is a meta keyword";
Page Meta Info
Response.RedirectPermanent(url); //issues HTTP 301
Permanent Redirect
HttpRequest.Browser.HttpBrowserCapabilities
Browser Capabilities (updated for new browsers + mobile)
![Page 22: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/22.jpg)
Provider-based
Output Caching
<!--web.config--><caching> <outputCache defaultProvider="AspNetInternalProvider"> <providers> <add name="DiskCache" type="Test.OutputCacheEx.DiskOutputCacheProvider,
DiskCacheProvider"/> </providers> </outputCache> </caching>
<%--Configure cache provider per page/control--%><%@ OutputCache Duration="60" VaryByParam="None" providerName="DiskCache" %>
?
![Page 23: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/23.jpg)
Newly extensible:– Object Caching
• System.Runtime.Caching
– Invalid Path Characters– Request Validation– Encoding
• <httpRuntime encoderType="Samples.MyCustomEncoder, Samples" />
– Browser Capabilities
Extensibility
![Page 24: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/24.jpg)
New– QueryExtender
Improved– ListView– FormView– Paging– Outer tables– Hidden DIV CSS
Controls
![Page 25: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/25.jpg)
Client-side libraries
Microsoft Ajax Libraries are dead*– Long live jQuery
What does it mean?For new client-side development, use jQuery
*NOTE: jQuery ships with ASP.NET 4
![Page 26: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/26.jpg)
Dynamic Data
Core benefits:– Model-driven validation– Field Templates
Now more
flexible!
//Enable via CodeGridView1.EnableDynamicData(typeof(Product),
new { ProductName = "DefaultName" });
<!--OR Enable declaratively on page-%><asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true"> <DataControls> <asp:DataControlReference ControlID="GridView1" /> </DataControls> </asp:DynamicDataManager>
![Page 27: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/27.jpg)
jQuery & MVC
Baked-in to ASP.NET
![Page 28: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/28.jpg)
What’s Next
Razor & WebMatrix
![Page 29: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/29.jpg)
For your research…
Changes to control renderingNew control featuresClient controls & Ajax librariesIIS changesVS 2010 changesASP.NET MVC 2Windows Azure
![Page 30: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/30.jpg)
It’s too much!
![Page 32: What’s New in ASP.NET 4](https://reader035.vdocuments.site/reader035/viewer/2022062511/54b7abc74a795993718b498d/html5/thumbnails/32.jpg)
Additional ResourcesWhat’s New in Microsoft ASP.NET 4 Web Forms and Dynamic Data– http://www.microsoftpdc.com/2009/FT58
Extensible output caching– http://www.4guysfromrolla.com/articles/061610-1.aspx
(Disk Cache Example Code)
WebForms Routing– http://www.west-wind.com/weblog/posts/54760.aspx
(Good discussion of ClientIDMode on Rick’s blog)