blog

Home / DeveloperSection / Blogs / Difference between MVC and Asp.netWeb Form

Difference between MVC and Asp.netWeb Form

Manish Kumar3148 21-Jan-2017

Asp.net Web Form

Asp.net web form follow a traditional event driven development model.

Asp.net web form has server controls

Asp.net web form supports view state for state management at client side.

Asp.net web form has file-based URLs means the name exist in the URLs must have its physically existence.

Asp.net web form follow web form syntax.

In asp.net web form .View are tightly coupled to code behind aspx.cs ie. Logic

Asp.net web form has master pages for consistent look and feels.

Asp.net web form has user controls for code re-usability.

Asp.net web form has built-in-data controls and best for rapid development with powerful data access.

Asp.net web form is not open source.                      

Asp.net mvc

Asp.net mvc is a lightweight and follow mvc(model view controller) pattern based development model.

Asp.net has html helpers.

Asp.net does not support view state.

Asp.net mvc has rout-based urls means urls are divided into controllers and actions and more ever it is based on controller not on physical file.

Asp.net mvc follow customizable syntax(razor as default)

In asp.net mvc view and logic are kept separately

Asp.net mvc has layout for consistent look and feels.

Asp.net mvc has partial view for code re-usability

Asp.net mvc is lightweight provide full control over markup and support many features that allow fast & style development hence it is fast for developing interface with application with latest web standard

Asp.net web mvc is an open source.

MVC (Model view Controller)

Model-It represents database logic, entity

View-View presentation layer.html.aspx, cshtml

Controller-controller controlled incoming request

In MVC controller is the most important part of mvc design patter it is called heart of the mvc. Because all the request comes to a controller first of all and then appropriate view is displayed with the help of suitable model. Such controller is called front controller of home controller.

In case of asp.net web form

http://localhost/myweb/welcome.aspx

webserver IIS/cassini

myweb folder

In case of mvc

http://localhost/myweb/welcome

webser iis/cassini

myweb folder

Homecontroller/defaultcontroller/frontcontoller

In mvc it will look for the action method .Action method is defined like a function or method inside the controller.

Advantages of mvc

1-Light weight application

2-Highly secured application

3-Highly modularized and reusable code

4-Better utilization of html, css and JavaScript, provides full control over html

5-Provides code generation framework ie scaffold

6-Provide annotation based validation

7-Provide entity framework for create crud application easily.

You can also visit related articles and blogs

Difference between ASP.NET and ASP.NET MVC 


Updated 17-Mar-2018

Leave Comment

Comments

Liked By