Hướng dẫn sử dụng ASP NET MVC 3
ASP.NET MVC 3 Tools Update Release Notes !"#$%&!' !"#$%& &( !"#$%&#) * &*+,-() (* !"#$%&!'*.,/ !'$0123 !'4'567'567'56%3 !' "#"689:1;<93 !'=+;<91> ?1> !"#$%&# !1 &6(@>11$& Overview #(+(4 !"#$%%>1> Note#((%( !"#$%&#$ #((;464 !"#$%&(A( +6(+ !"#$%&49(($;%;&B$%&CD4E+ #( !"#$%&#(4F • !"#$%&; • !"#$%&%>1> • !"#E+!; • !"#E+!%>1> • $!9$4"#B<C1 • (G,4%>1>(+406, #(444(;4 !"#$%&+4( !"# +(4HF (DFIIII(I;; Installation Notes Important Note: Please make sure that all Visual Studio instances are closed before installing ASP.NET MVC 3 Tools Update. # !"#$%&#(E+!GBE+!C7(4 F (DFIII+I6I,JK$%& 676(4 !"#$%%>1> 4(4F (DFIII49IJH9K>/1:> !"#$%&#+;+6;( !"#$%% >1>466( !"#$%&#$76+6( !"# $%&##((, !"#$%& !"#$%&# ! &6(@>11$& Software Requirements #( !"#$%&;(4F • "#89: !"#$%&%>1>(4F • %>1>%E+>1>", Documentation 4 !"#$%&+($+(4HF (DFIII49IJH9K>)212 #(4+ !"#$%&+($%&4( !"# +(4HF (DFIIII Support #(464+L(+4( $+ 44+(( !"#$%&47(+4( !"#646+4F (DFII4I11:M, Upgrading an ASP.NET MVC 2 Project to ASP.NET MVC 3 #6, !"#$%&7(4F 1 &6 !"#$%&'6#('N (4( &6(4N4( !"#$%&'(46 !"#$%&'OP64('56+64( NB'56;1)1'CF • !"#$%&# ! &6(@>11$& • • • &6(4(4(6 !"#$%&'(4 67(((6((QN : 46 !"#$%&'676(N( 44( ) +(N( !"#$%&'7+6(( !"#$%& 8(4F System.Web.Mvc, Version=2.0.0.0 ((4F System.Web.Mvc, Version=3.0.0.0 M Solu#on Explorer7(4B(((HH4 C7(4Bv3.0.0.0C 2 4 !#(+ (44F • "#"$ % &'()$&'() *$& • "#"$ % &'()$&'() $+,$& / Solu#on Explorer7(;9('Unload Project#((;9( 'Edit ProjectName.csproj 3 H() {F85E285D-A4E0-4152-9332-AB1D724D3325}( {E53F8FEA-EAE0-44A6-8774-FFD645390401} 1> ((7(;9('7(Reload Project 11 (QN7(4L( <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 1 4('46(;6+( !"#$%&7( 4(((/(N( (.0F !"#$%&# !: &6(@>11$& <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0"/> </dependentAssembly> </assemblyBinding> </runtime> Changes in ASP.NET MVC 3 Tools Update #(+(( !"#$%&#( !"# $%&#$ "Add Controller" dialog box can now scaffold controllers with views and data access code -649646 (( +766'Q #((Add Controller+, !"#$%&7(;9(Controllers4Solu#on Explorer79Add7(9Controller#(+,(+(- - !"#$%&# !) &6(@>11$& #((-++64 Empty Controller #(6N#((9Add ac#ons for create, edit, details, delete scenarios4 !"#$%&46((7 4(+ Controller with empty read/write actions #(N((((+ ((#((9Add ac#ons for create, edit, details, delete scenarios4 !"#$%&46((74(+ Controller with read/write actions and views, using Entity Framework #(+6969;64( (47((4F • 1 #(+9(("6 89&8(46(,,46( !"#$%&# !M &6(@>11$& 129(("689+8$ 8(46(,32 • 0#( !"#$%&+4( 4+6#(+; 7((/4.5D+7 • 366 046N;;64;96(+6 7(;48,7 6(N(44"689&8F public class Product { public int ProductId { get; set; } [Required] public string Name { get; set; } // Product belongs to Category public int CategoryId { get; set; } public virtual Category Category { get; set; } } public class Category { public int CategoryId { get; set; } [Required] public string Name { get; set; } } E(6(-4(.7( +'4(. #(+(Add Controller+,8Model class76 (667(((64(++ F • 46"689&876(6 • 46"689+8"689$87+( 6N6 8Data Context class769((F • 46&8(,,7(<New data context…>R ,(+46 !"#$%&# !2 &6(@>11$& • 46&8(,,7((+ (6( • 46+8$87(6+',( 8Views7((67(None46P-6 O Advanced Op#ons 464(4(8,76 ((6 Improvements to the "ASP.NET MVC 3 New Project" Dialog Box #(+,6 !"#$%&'7 + !"#$%&# !/ &6(@>11$& New "Intranet Project" Template #(Project TemplateIntranet Applica#on#(L 4++E(44(. L(Q+'7( N(4(9('9 4(Intranet Applica#on+($+( 4HF (DFIII;I+6I2>B%3/C, Project templates are now HTML5 enabled #(;'+,S#$H);N4(' (+((S#$H)787 7987708 (4+S#$H);N#(7( S#$H)'4($0+6B(,C Project templates now include Modernizr 1.7 $0=+6(+4&S#$H)+(6 (4#(+6;<94 !"# $%&'84+$07(DFII0I Project templates include updated versions of jQuery, jQuery UI, and jQuery Validation #('(44('56F • '561)1 • '56%1/ • '561/11 #(+;<9 Project templates now include ADO.NET Entity Framework 4.1 as a pre-installed NuGet package #( "#"689:1(&84&8 D4( "#"689((,+8 $8D !"#$%&# !3 &6(@>11$& &84N6!&B*&H+'*CD %.&T#((+,++ +( N+1&0D+ U ! 4&8 ( !"#$%&+( !"#+( 4HF (DFIIIIIL;;(;;1; (DFIII6;49II;;6;49;;;4;;; ;; Project templates include JavaScript libraries as pre-installed NuGet packages E(6 !"#$%&'7('(=N 6B4,7($0+6C+6(<46 ((4('#(+6< (((4( 8,7(464'567(4'56(' +4S7+'56< 976+N(<+,(4'56+ .'56(+(N7'56( (78(4('56N(N( +(+(7(6+6 ( Known Issues • 764((V4( B>,/>>2>M:CR84+(9(7?. )1)MM • #(-4-(946 (("6898,7+(P( +6.7-(.( • & !"#$%&'(4'./9(20 #(9( !"#$%&'(4(( (4 • 406,9((46(( 94(0 !"#$%&7( !"#$%&# !1> &6(@>11$& [...]... for ASP. NET MVC will show snippets for aspx views ASP. NET MVC 3 does not include any snippets for Razor views If you install ASP. NET MVC 3 for Visual Web Developer Express on a computer where Visual Studio is not installed, and then later install Visual Studio, you must reinstall ASP. NET MVC 3 Visual Studio and Visual Web Developer Express share components that are upgraded by the ASP. NET MVC 3 installer... Developer Express share components that are upgraded by the ASP. NET MVC 3 installer The same issue applies if you install ASP. NET MVC 3 for Visual Studio on a computer that does not have Visual Web Developer Express and then later install Visual Web Developer Express ASP. NET MVC 3 Tools Update Release Notes Copyright © 2011 Microsoft Corporation Page 11 Disclaimer © 2011 Microsoft Corporation All rights... views expressed in this document, including URL and other Internet Web site references, may change without notice You bear the risk of using it This document does not provide you with any legal rights to any intellectual property in any Microsoft product You may copy and use this document for your internal, reference purposes ASP. NET MVC 3 Tools Update Release Notes Copyright © 2011 Microsoft Corporation . !"#646+4F (DFII4I11:M, Upgrading an ASP. NET MVC 2 Project to ASP. NET MVC 3 #6, !"#$%&7(4F 1. Please make sure that all Visual Studio instances are closed before installing ASP. NET MVC 3 Tools Update. # !"#$%&#(E+!GBE+!C7(4 F (DFIII+I6I,JK$%&