ASP.NET MVC

The ASP.NET MVC is a web application framework developed by Microsoft. ASP.NET MVC is also one of the programming models supported by Microsoft ASP.NET technology. It is an open-source framework while ASP.NET Web Forms was a complete proprietary of Microsoft.

What is ASP.NET MVC?

ASP.NET MVC is a framework developed by Microsoft to build web applications. ASP.NET MVC is built on the top of ASP.NET. It used the ASP.NET pipeline for request processing.

Though, MVC is based on Model-View-Controller design pattern.

  • Model: Model denotes DTOs or POCO Classes or View Models that will be used to bind data to view.
  • View: View here represents the UI layer. All the HTML required to render a page is written in this section.
  • Controller: Controller is the main part. It captures the control when a request arrives, Action method defined in the controller gets called. This action method fills data in ViewModels & then we return a view that will render that data on some HTML page.


Can you please explain Model, View & Controller in MVC?

Please find below the explanation of Model, View & Controller:

  • Model: Model denotes DTOs or POCO Classes or View Models that will be used to bind data to view.
  • View: View here represents the UI layer. All the HTML required to render a page is written in this section.
  • Controller: Controller is the main part. It captures the control when a request arrives, Action method defined in the controller gets called. This action method fills data in ViewModels & then we return a view that will render that data on some HTML page.


What are few advantages of using ASP.NET MVC over Web Forms?

Advantages of ASP.NET MVC over Web Forms:

  1. More control over HTML markup. In ASP.NET Web Forms, we remain dependent on the markup generated by ASP.NET Controls.
  2. Request pipeline is quite easy & straight-forward. As MVC does not have any page lifecycle events.
  3. Better Routing Support.
  4. No ViewState concept.
  5. CSS & JS Bundling support.
  6. SEO Friendly URLs
  7. Enables Test Driven Development.


Can you please explain page life cycle in MVC?

.


What are different Action Results available in MVC?

.


What are Filters in MVC?

  1. List out all filters.
  2. Here explains what filter can be used for what purpose?


Name few action filters which ASP.NET MVC provides by default?

ASP.NET MVC provides the following action filters:

Output Cache: This action filter caches the output of a controller action for a specified amount of time. Handle Error: This action filter handles errors raised when a controller action executes. Authorize: This action filter enables you to restrict access to a particular user or role


How does routing work in ASP.NET MVC?

.


What is Bundling & Minification in ASP.NET MVC?

.


What is the meaning of Unobtrusive JavaScript?

.


This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. For more information - please visit our private policy.