Views: 842
ASP.NET MVC 2: ASP.NET MVC 2 is the next significant update of ASP.NET MVC. ASP.NET MVC 2 builds on ASP.NET MVC 1.0. MVC 2 can be used with asp.net 3.5 SP1 and With ASP.NET 4.O. In ASP.NET MVC 2 improves the maintainability of the application. You can update asp.net MVC 1.0 protects to ASP.NET MVC 2. It is a compatible update to ASP.NET MVC 1 – so all the knowledge, skills, code, and extensions you already have with ASP.NET MVC continue to work and apply going forward.
Definition: Input logic, business logic, and UI logic is called MVC. MVC is designed on following three attribute.
M (model),
V (View),
C (controller)
Model: To build a model with business rules, validation and aggregation logic is called Model. For Example, Linq to SQL.dbml files.
View: UI of asp.net Application is called View. For Example, Home, Account, Shared three folders in View Folder in this Project. In the Account folder is used for UI for logging and change password.
Controller: Logic of application is called Controller. For Example, In this Project Controller folder includes AccountController and HomeController files which contains the flow of login information
ASP.NET MVC 2 Features: ASP.NET MVC 2 adds a bunch of new capabilities and features. Some of the new features and capabilities in MVC 2 are given below.
New Strongly Typed HTML Helpers
Enhanced Model Validation support across both server and client
Auto-Scaffold UI Helpers with Template Customization
Support for splitting up large applications into “Areas”
Asynchronous Controllers for parallel long running tasks and enable to Asynchronous Operations Matter
Support for rendering sub-sections of a page/site using Html.RenderAction
Lots of new helper functions, utilities, and API enhancements Improved Visual Studio tooling support
Template Helper to use Lambda Expression.
Area to split large project to avoid the complexity of the large project. Right Click on your Project in the Solution Explorer, click Add and then click Area. Now you can add forum or admin in the Area Strongly Typed UI Helpers to view model level error instead of all validation Errors.
HiddenInputAttribute Class for Templated Helpers when DisplayValue is false nothing will be happen but when DisplayValue is true then input hidden element will be rendered when displaying model in editor template
Enhancements to ModelBinders
Automatic HTML-Encoding
Enhancements to ModelBinders supports are:
Increasing Security with HTTPS
Avoiding the JSON Array Attack
Short Notation for AcceptVerbs Attribute
Overriding the HTTP Verb
Binary Binding
Ability to render subsections of site pages
Tags:
ASP.NET MVC 2 Framework ASP.NET Development