Thursday, 13 February 2014

Creating an Asp.Net MVC Application :-

Step-1 Open Visual Studio 2010

Step-2 Click on New Project 

 


Step-3 Select Web from Installed Template[Left Side] 

Select ASP.NET MVC 4 web Application

Select Name & Location & Press OK

Step-4 Select Internet Application from Project Template

Select View Engine as Razor

Step-5 On Solution Explorer, See the structure of folder


Step-6 This is solution structure

Step-7 This is output


Versions of MVC


 Below is a detailed table of differences. But during an interview it’s difficult to talk about all of them due to time limitation. So I have highlighted the important differences that you can run through before the interviewer.

MVC 2  MVC 3 MVC 4 
  • Client-side validation
  • Templated Helpers Areas
  • Asynchronous Controllers
  • Html.ValidationSummary Helper Method
  • DefaultValueAttribute in Action-Method
  • Parameters binding
  • Binary data with Model Binders
  • DataAnnotations Attributes
  • Model-Validator Providers
  • New RequireHttpsAttribute Action Filter
  • Templated Helpers
  • Display Model-Level Errors
  • Razor
  • Readymade project templates
  • HTML 5 enabled templates
  • Support for Multiple View Engines, JavaScript, and AJAX
  • Model Validation Improvements
  • ASP.NET Web API
  • Refreshed and modernized default project templates. New mobile project template.
  • Many new features to support mobile apps
  • Enhanced support for asynchronous methods

Intro to ASP.NET MVC 4

Introduction     
ASP.NET MVC 4 is a framework for building scalable, standards-based web applications using well-established design patterns and the power of ASP.NET and the .NET Framework. 
In this article I will give an introduction to ASP.NET MVC 4 from a beginner’s perspective.

What is ASP.NET MVC ?  

ASP.NET supports three different development models named Web Pages, MVC and Web Forms.

ASP.NET MVC is a web application development framework built on top of Microsoft’s .NET Framework. ASP.NET Web Form was a replacement for Microsoft’s Active Server Pages (ASP) but ASP.NET MVC is not a replacement for ASP.NET Web Forms and it’s just an alternate way of making an ASP.NET website.

ASP.NET MVC is open source!- In March 2012, Scott Guthrie announced on his blog that Microsoft had released part of their web stack (including ASP.NET MVC, Razor and Web API) under an open source license (Apache License 2.0).

Why MVC ?  

ASP.NET MVC helps to reduce the complexity of the web application by dividing an application into three layers, Model, View and Controller. This separation (loose coupling) helps in some long term benefits like isolation of components while development and also this separation provides better support for test-driven development (TDD). 
ASP.NET MVC web site are good in performance and also easy to maintain. 

Architecture of MVC






MVC Stands for Model, View & Controller. It is a design pattern to make application in parallel programming.

The Model is the part of the application that handles the logic for the application data.
Often model objects retrieve data (and store data) from a database.

The View is the parts of the application that handles the display of the data.
Most often the views are created from the model data.

The Controller is the part of the application that handles user interaction.
Typically controllers read data from a view, control user input, and send input data to the model.

The MVC separation helps you manage complex applications, because you can focus on one aspect a time. For example, you can focus on the view without depending on the business logic. It also makes it easier to test an application.

The MVC separation also simplifies group development. Different developers can work on the view, the controller logic, and the business logic in parallel.