Académique Documents
Professionnel Documents
Culture Documents
5
1
Email: kiemhh@fpt.com.vn
Agenda
2
This is the Web Platform for Professional Developers. It combines a rich and powerful web application framework with a supporting cast of tools, servers, technologies and applications for creating, designing, developing and delivering web solutions.
ASP.NET MVC 4
compatibility
Smart Tasks
Extract To User Control Highlight the a piece of code, right-click and select Extract to User Control in menu
HTML5 snippets
Element Matching
When we rename an HTML element (change a div tag to be a header tag), the corresponding opening or closing tag also changes in real time.
Smart indent
HTML Enhancements
10
CSS Editor Hierarchical Indentation CSS Editor Snippets CSS Color Picker Better Cross Browser support
Support for
Go To Definition Brace Matching Outlining
Page Inspector
16
Page Inspector is a tool that renders a web page (HTML, Web Forms, ASP.NET MVC, or Web Pages) in the Visual Studio IDE and lets you examine both the
Page Inspector
17
ASP.NET Runtime
18
Script Libraries as NuGet Packages Web Optimization Async Universal Providers Request Validation Data Annotations Miscellaneous Support for WebSockets Protocol
ASP.NET Runtime
Today
Project templates ship with script libraries jQuery jQuery UI Libraries are updated and template is out of date Where do I go to get latest version?
Visual Studio 11
Script libraries are included as NuGet packages Updated automatically via NuGet Package Manager
ASP.NET Runtime
Web Optimization
20
Modern HTML pages can include lots of CSS and JavaScript references
Each one is retrieved with a separate HTTP request Not automatically minified
ASP.NET 4.5 can bundle and minify your JavaScript and CSS
ASP.NET Runtime
Default JavaScript bundling behavior Take all JavaScript files in a certain folder Sort them alphabetically Then reordered so that know libraries are loaded first (jQuery, Dojo, MooTools) The default bundle is called js Include the following script link to load the default bundle in your page
ASP.NET Runtime
The default bundle is called css Include the following script link to load the default bundle in your page
ASP.NET Runtime
You can register your own bundles in Global.asax for custom processing
ASP.NET Runtime
Async
24
ASP.NET Runtime
Asynchronous HttpModule
25
Suppose to perform asynchronous work within a method that returns a Task object
ASP.NET Runtime
Asynchronous HttpHandler
26
The traditional approach to writing asynchronous handlers in ASP.NET is to implement the IHttpAsyncHandler interface
ASP.NET Runtime
Universal Providers
27
Membership, Profile, Role, Session providers only work against certain version of SQL Server
ASP.NET Runtime
Request Validation
28
History:
.NET 2.0
<%@ ValidateRequest=false %> disabled validation for the entire page
.NET 4
Request validation was moved earlier in the pipeline allowing protection of Modules. To turn it off for a page you had to revert to the 2.0 mode losing the new protection
ASP.NET Runtime
Request Validation
29
ASP.NET 4.5
30
Data Annotations
Compare CreditCard EmailAddress FileExtension Phone Url DataType CreditCard PostalCode Upload
Miscellaneous
Startup performance & working set improvements Incremental file upload Allow uploads > 2GB Anti-XSS encoders ASP.NET admin modules And more
ASP.NET 4.5
HTML 5
31
SP1: <input type=date runat=server /> vNext: <asp:TextBox runat=server TextMode=Date />
ASP.NET 4.5
Project Templates
32
HTML 5
Dynamically updates to device size Modernizer library Templates use HTML 5 that gracefully falls back on older browsers
ASP.NET 4.5
Strongly Typed Data Expressions Intellisense Compile time not run time errors
ASP.NET 4.5
Model Binding
34
ASP.NET 4.5
ASP.NET 4.5
ASP.NET 4.5
ASP.NET 4.5
ASP.NET 4.5
ASP.NET 4.5
ASP.NET 4.5
Ubobtrusive Javascript
41
ASP.NET 4.5
Ubobtrusive Javascript
42
<asp:TextBox runat="server" ID="txtFirstName" /> <asp:RequiredFieldValidator ID="rfvFirstName" runat="server" ControlToValidate="txtFirstName" ErrorMessage="Please enter a value for First Name" />
ASP.NET 4.5
Ubobtrusive Javascript
43
<script src="Scripts/jQuery-1.8.2.js" type="text/javascript"></script> <script src="Scripts/jQuery.validate.js" type="text/javascript"></script> <script src="Scripts/jQuery.validate.unobtrusive.js" type="text/javascript"></script> <input name="txtFirstName" type="text" id="txtFirstName" data-val="true" data-val-focusonerror="false" data-val-required="Please enter a value for First Name" /> <span id="rfvFirstName" class="field-validation-valid" data-valmsg-for="txtFirstName" data-valmsg-replace="true"> </span>
ASP.NET 4.5
WebSockets protocol is a standards-based network protocol that defines how to establish secure, real-time bidirectional communications between a client and a server over HTTP. The WebSockets protocol is supported by any client (not just browsers), and mobile operating systems.
WebSockets protocol makes it much easier to create longrunning data transfers between a client and a server
ASP.NET 4.5
ASP.NET 4.5
ASP.NET MVC 4
Overview Release Details Supports Visual Studio 2010 Ship in box with Visual Studio 11 Feature Overview Mobile Support and Mobile Template Single Page Applications WCF Web API
ASP.NET MVC
ASP.NET Routing Model binding Validation Filters Link generation Testability Dependency resolver
http://www.nuget.org
http://aka.ms/mbl-tech http://aka.ms/mbl-tech/devprev http://aka.ms/mbl-tech/html5 http://www.asp.net/vnext
ASP.NET 4.5
50