What is difference between ASP.NET WebForm and ASP.NET MVC?


The main differences between ASP.NET Web Form and ASP.NET MVC are given below:

ASP.NET Web Forms

  • ASP.NET Web Form follows a traditional event driven development model.
  • ASP.NET Web Form has server controls.
  • ASP.NET Web Form has state management (like as view state, session) techniques.
  • ASP.NET Web Form has file-based URLs means file name exist in the URLs must have its physically existence.
  • ASP.NET Web Form follows WebForm Syntax
  • In ASP.NET Web Form, Web Forms (ASPX) i.e. views are tightly coupled to Code behind (ASPX.CS) i.e. 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, and Controller) pattern based development model.
  • ASP.NET MVC has html helpers.
  • ASP.NET MVC has no automatic state management techniques.
  • ASP.NET MVC has route-based URLs means URLs are divided into controllers and actions and moreover it is based on controller not on physical file.
  • ASP.NET MVC follow customizable syntax (Razor as default)
  • In ASP.NET MVC, Views and logic are kept separately.
  • ASP.NET MVC has Layouts for consistent look and feels.
  • ASP.NET MVC has Partial Views for code re-usability.
  • ASP.NET MVC is lightweight, provide full control over mark-up and support many features that allow fast & agile development. Hence it is best for developing interactive web application with latest web standards.
  • ASP.NET Web MVC is an Open Source.