ASP.NET MVC Request Processing

ASP.NET MVC Request Processing:



One of the most important concepts to understand about MVC applications is that no relationship exists between a page request and a physical file inside the web server. In a traditional Web Forms and Web Pages application, every page request is translated into a call to a physical file in the webserver. For example, if your request is something like  http://myapp/mypage.aspx, the web server interprets the request by looking at the root of the website for a file named mypage.aspx.It then processes the file and returns the generated HTML.


In the case of an MVC application, when you make a request (e.g., http://myapp/product/list), a component called  routing engine matches the request to a specific route.

 A  route defines requests using a pattern string and establishes the controller and method in the controller class that should process the request. Once the route is identified, the routing engine creates a request handler that in turn will create the controller object that will process the request (in our example, the controller is “product”). The controller then invokes the method in the controller class that will process the request (in the example is named “list”). These methods in controller classes that process requests are called action methods. When the processing of the request ends, the action method produces a result to send back to the user. Normally the result is some HTML (rendered by a View) the user will see in the browser.



We will examine the routing engine in more detail other post Figure  illustrates the entire server-side processing life cycle in an ASP.NET MVC web application

.



Other Related Post :




Comments

Popular posts from this blog