Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

ZZ BC#8 Hello ASP.NET MVC 4 (dks)


Published on

สรุปงาน ZZ BC#8 : Hello ASP.NET MVC 4
เมื่อวันเสาร์ที่ 2 มิถุนายน 2555

Demo Code:

ตัวอย่าง ZZMVCChat: ใช้ mvc 4 last nightly build version เพราะ RC ไม่มี PushStreamContent class
และหากทดสอบข้ามเครื่องต้องใช้ iis + ip/dns เช่น
** window.EventSource เป็น HTML5 feature

แล้วพบกันใหม่ meeting หน้าครับ

Published in: Technology
  • Be the first to comment

  • Be the first to like this

ZZ BC#8 Hello ASP.NET MVC 4 (dks)

  1. 1. About me0 Chalermpon Areepong 0 Microsoft MVP Thailand (ASP.NET)0 Work for ICBC THAI0 Blog http://nine69.wordpress.com0 User Group
  2. 2. AGENDA0 Enhancement to default project template0 New Razor 2.00 Bundling and Minification0 ASP.NET WEB APIs0 Enhanced support for asynchronous methods0 New Mobile Support
  3. 3. Enhancements to Default Project Templates0 Design for adaptive rendering to look good in both desktop browsers and mobile browsers without any customization.
  4. 4. Demo0 Show new default project template
  5. 5. New Razor 2.00 Razor now supports conditional attributes. In an HTML element<input type="checkbox“ name="check1" value="check1" checked="@checked1" />0 Support path “~/” for all HTML attributes
  6. 6. Demo0 Razor 2
  7. 7. Bundling and Minifacation0 Reduce size of script and css file (remove whitespace)0 New App_Start Folder 0 BundleConfig.cs0 BundleConfig. RegisterBundles() bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-1.*")); bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css")); *changes from Beta0 Call in View @Scripts.Render("~/bundles/jquery") @Styles.Render("~/Content/themes/base/css", "~/Content/css")
  8. 8. Demo0 Bundling and Minifacation
  9. 9. ASP.NET WEB APIs0 Change name from WCF Web API0 Easy to build HTTP services0 Support Browsers and Mobile devices0 Build RESTful applications on the .NET Framework
  10. 10. ASP.NET WEB APIs HTTP get, post, etc. Device App Request json, xml, form ASP.NET Web App WEB API Response json, xml OthersHTTP Request
  11. 11. ASP.NET WEB APIs0 Modern HTTP programming model: Directly access and manipulate HTTP requests and responses in your Web APIs using a new, strongly typed HTTP object model.0 Full support for routes:0 Content negotiation: support for XML, JSON, and Form URL- encoded formats and custom format.0 Model binding and validation: like controller base0 Filters: support filter such as [Authorize]attribute.0 Query composition: Use the [Queryable] filter attribute on an action that returns IQueryable to enable support for querying your web API via the OData query conventions.0 Improved Testability: use HttpRequestMessage and HttpResponseMessage to create a unit test project
  12. 12. ASP.NET WEB APIs0 Code-based configuration: ASP.NET Web API configuration is accomplished solely through code, leaving your config files clean. Use the provide service locator pattern to configure extensibility points.0 Improved support for Inversion of Control (IoC) containers: support dependency resolver abstraction0 Self-host: Web APIs can be hosted in your own process in addition to IIS while still using the full power of routes and other features of Web API.0 Create custom help and test pages: using the new IApiExplorer service to get a complete runtime description of your web APIs.0 Monitoring and diagnostics: System.Diagnostics, ETW and third party logging frameworks.0 Link generation: Use the ASP.NET Web API UrlHelper to generate links to related resources in the same application.0 Web API project template: new project template0 Scaffolding: by Add Controller dialog to quickly.
  13. 13. Demo0 Basic Web API0 SelfHost ( AspNetWebApi.Selfhost )0 MVC Chat
  14. 14. Enhanced support for asynchronous methods0 Support Async in .NET Framework 4.5 0 TASK<T>0 New “async”, “await” keyword0 Reduce async code public async Task<ActionResult> GetSocialDatas(string username){ var facebook = new FBService(); var twitter = new TwitterService(); return View(“SocialData", new SocialDataViewModel { FBWalls = await facebook.GetWallsAsync(string username), TwTimeLines = await twitter.GetTimeLineAsync(string username) }); }
  15. 15. Demo0 MVC New Async Operation
  16. 16. New Mobile Support0 Mobile Project Template 0 jQuery mobile script 0 Mobile Theme
  17. 17. New Mobile Support0 ViewSwitcher 0 Detect device 0 Switch view to mobile layout 0 Can create layout for device by specification
  18. 18. Demo0 New Mobile Support
  19. 19. End