python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
The ASP.Net MVC Process Request Life Cycle

What Is ASP.Net MVC Application Life-Cycle?

What Is MVC?
The MVC is a framework, standard pattern for developing Web applications and MVC framework handled by three objects Model, View and Controller.

MVC Application Life-Cycle -

In short - MVC application Life Cycle Steps
1.      Creating the request object -
a.      Fill route
b.      Fetch route
2.      Request context created
3.      Controller instance created
4.      Creating Response object

MVC Application Life Cycle Steps - In detail
Firstly, I am going to share the MVC process request and after will discuss over the process request life cycle.

When you send the request to MVC application that means you are directly calling the controller's ActionMethod i.e. http://localhost:42955/Customers/Index

In the above requested URL, Customers is a controller and Index is an ActionMethod that directly calling to action method for a particular controller.

Process Request Life Cycle -

Step 1When you send a request to MVC Applications.
Step 2Create an instance of the RouteTable class.  It does create the first time when your MVC application start.

The RouteTable class hold the collection of objects and it does derive from the RouteBase class.

Step 3After that, the UrlRoutingModule interrupt each and every request and find you’re matching RouteData from your RouteTable and create an instance of MVC Handler as the HttpHandler.

Step 4After that, the MVC handler is create the DefaultControllerFactory. Its process the RequestContext and get the specific controller that you called and it’s create the ControllerContext and execute the controller.

Step 5After that, get the ActionMethod from the RouteData and builds controller's ActionMethod based on your request.

Step 6After that, the ActionMethod returns the ActionResult and renders the view.

You can see in the below images-

Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - and
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like Powered by Blogger.
ASK Questions