Monday, June 12, 2017

Working With Model View Controller - ASP.NET

Overview:

MVC is an architectural design pattern that separates an application into three main layers:

1. Model
2. View
3. Controller

Model
- Implements logic

View
- Displays UI

Controller
- Acts as User Interaction (similar to that of a button click in asp.net)
- Handles and responds to user input and interaction
- Works with model
- Selects a view to be rendered

MVC Life Cycle:

  •  User enters an URL in the browser and submits the request.
    • URLRoutingModule : - Entry point to MVC application
      • This is an HTTP module. It intercept the request and decides whether the request is handled by MVC application.
      • Selects the first matching route.
      • In Application_Start event of Global.asax.cs file, routes are added to the RouteCollection.
        • RouteConfig.RegisterRoutes(RouteTable.Routes);
        • Inside the RegisterRoutes method, routes.MapRoute method is used to map the specified URL route and sets default route values.



No comments:

Post a Comment

SQL INTERVIEW QUESTIONS (SCENARIO BASED) - Part 1

FINDING Second Highest Salary in SQL CREATE TABLE #EMP ( NAME NVARCHAR ( 100 ), SALARY BIGINT ) INSERT INTO #EMP VALUES (...