- Blog Categories
- Software Development Projects and Ideas
- 12 Computer Science Project Ideas
- 28 Beginner Software Projects
- Top 10 Engineering Project Ideas
- Top 10 Easy Final Year Projects
- Top 10 Mini Projects for Engineers
- 25 Best Django Project Ideas
- Top 20 MERN Stack Project Ideas
- Top 12 Real Time Projects
- Top 6 Major CSE Projects
- 12 Robotics Projects for All Levels
- Java Programming Concepts
- Abstract Class in Java and Methods
- Constructor Overloading in Java
- StringBuffer vs StringBuilder
- Java Identifiers: Syntax & Examples
- Types of Variables in Java Explained
- Composition in Java: Examples
- Append in Java: Implementation
- Loose Coupling vs Tight Coupling
- Integrity Constraints in DBMS
- Different Types of Operators Explained
- Career and Interview Preparation in IT
- Top 14 IT Courses for Jobs
- Top 20 Highest Paying Languages
- 23 Top CS Interview Q&A
- Best IT Jobs without Coding
- Software Engineer Salary in India
- 44 Agile Methodology Interview Q&A
- 10 Software Engineering Challenges
- Top 15 Tech's Daily Life Impact
- 10 Best Backends for React
- Cloud Computing Reference Models
- Web Development and Security
- Find Installed NPM Version
- Install Specific NPM Package Version
- Make API Calls in Angular
- Install Bootstrap in Angular
- Use Axios in React: Guide
- StrictMode in React: Usage
- 75 Cyber Security Research Topics
- Top 7 Languages for Ethical Hacking
- Top 20 Docker Commands
- Advantages of OOP
- Data Science Projects and Applications
- 42 Python Project Ideas for Beginners
- 13 Data Science Project Ideas
- 13 Data Structure Project Ideas
- 12 Real-World Python Applications
- Python Banking Project
- Data Science Course Eligibility
- Association Rule Mining Overview
- Cluster Analysis in Data Mining
- Classification in Data Mining
- KDD Process in Data Mining
- Data Structures and Algorithms
- Binary Tree Types Explained
- Binary Search Algorithm
- Sorting in Data Structure
- Binary Tree in Data Structure
- Binary Tree vs Binary Search Tree
- Recursion in Data Structure
- Data Structure Search Methods: Explained
- Binary Tree Interview Q&A
- Linear vs Binary Search
- Priority Queue Overview
- Python Programming and Tools
- Top 30 Python Pattern Programs
- List vs Tuple
- Python Free Online Course
- Method Overriding in Python
- Top 21 Python Developer Skills
- Reverse a Number in Python
- Switch Case Functions in Python
- Info Retrieval System Overview
- Reverse a Number in Python
- Real-World Python Applications
- Data Science Careers and Comparisons
- Data Analyst Salary in India
- Data Scientist Salary in India
- Free Excel Certification Course
- Actuary Salary in India
- Data Analyst Interview Guide
- Pandas Interview Guide
- Tableau Filters Explained
- Data Mining Techniques Overview
- Data Analytics Lifecycle Phases
- Data Science Vs Analytics Comparison
- Artificial Intelligence and Machine Learning Projects
- Exciting IoT Project Ideas
- 16 Exciting AI Project Ideas
- 45+ Interesting ML Project Ideas
- Exciting Deep Learning Projects
- 12 Intriguing Linear Regression Projects
- 13 Neural Network Projects
- 5 Exciting Image Processing Projects
- Top 8 Thrilling AWS Projects
- 12 Engaging AI Projects in Python
- NLP Projects for Beginners
- Concepts and Algorithms in AIML
- Basic CNN Architecture Explained
- 6 Types of Regression Models
- Data Preprocessing Steps
- Bagging vs Boosting in ML
- Multinomial Naive Bayes Overview
- Gini Index for Decision Trees
- Bayesian Network Example
- Bayes Theorem Guide
- Top 10 Dimensionality Reduction Techniques
- Neural Network Step-by-Step Guide
- Technical Guides and Comparisons
- Make a Chatbot in Python
- Compute Square Roots in Python
- Permutation vs Combination
- Image Segmentation Techniques
- Generative AI vs Traditional AI
- AI vs Human Intelligence
- Random Forest vs Decision Tree
- Neural Network Overview
- Perceptron Learning Algorithm
- Selection Sort Algorithm
- Career and Practical Applications in AIML
- AI Salary in India Overview
- Biological Neural Network Basics
- Top 10 AI Challenges
- Production System in AI
- Top 8 Raspberry Pi Alternatives
- Top 8 Open Source Projects
- 14 Raspberry Pi Project Ideas
- 15 MATLAB Project Ideas
- Top 10 Python NLP Libraries
- Naive Bayes Explained
- Digital Marketing Projects and Strategies
- 10 Best Digital Marketing Projects
- 17 Fun Social Media Projects
- Top 6 SEO Project Ideas
- Digital Marketing Case Studies
- Coca-Cola Marketing Strategy
- Nestle Marketing Strategy Analysis
- Zomato Marketing Strategy
- Monetize Instagram Guide
- Become a Successful Instagram Influencer
- 8 Best Lead Generation Techniques
- Digital Marketing Careers and Salaries
- Digital Marketing Salary in India
- Top 10 Highest Paying Marketing Jobs
- Highest Paying Digital Marketing Jobs
- SEO Salary in India
- Brand Manager Salary in India
- Content Writer Salary Guide
- Digital Marketing Executive Roles
- Career in Digital Marketing Guide
- Future of Digital Marketing
- MBA in Digital Marketing Overview
- Digital Marketing Techniques and Channels
- 9 Types of Digital Marketing Channels
- Top 10 Benefits of Marketing Branding
- 100 Best YouTube Channel Ideas
- YouTube Earnings in India
- 7 Reasons to Study Digital Marketing
- Top 10 Digital Marketing Objectives
- 10 Best Digital Marketing Blogs
- Top 5 Industries Using Digital Marketing
- Growth of Digital Marketing in India
- Top Career Options in Marketing
- Interview Preparation and Skills
- 73 Google Analytics Interview Q&A
- 56 Social Media Marketing Q&A
- 78 Google AdWords Interview Q&A
- Top 133 SEO Interview Q&A
- 27+ Digital Marketing Q&A
- Digital Marketing Free Course
- Top 9 Skills for PPC Analysts
- Movies with Successful Social Media Campaigns
- Marketing Communication Steps
- Top 10 Reasons to Be an Affiliate Marketer
- Career Options and Paths
- Top 25 Highest Paying Jobs India
- Top 25 Highest Paying Jobs World
- Top 10 Highest Paid Commerce Job
- Career Options After 12th Arts
- Top 7 Commerce Courses Without Maths
- Top 7 Career Options After PCB
- Best Career Options for Commerce
- Career Options After 12th CS
- Top 10 Career Options After 10th
- 8 Best Career Options After BA
- Projects and Academic Pursuits
- 17 Exciting Final Year Projects
- Top 12 Commerce Project Topics
- Top 13 BCA Project Ideas
- Career Options After 12th Science
- Top 15 CS Jobs in India
- 12 Best Career Options After M.Com
- 9 Best Career Options After B.Sc
- 7 Best Career Options After BCA
- 22 Best Career Options After MCA
- 16 Top Career Options After CE
- Courses and Certifications
- 10 Best Job-Oriented Courses
- Best Online Computer Courses
- Top 15 Trending Online Courses
- Top 19 High Salary Certificate Courses
- 21 Best Programming Courses for Jobs
- What is SGPA? Convert to CGPA
- GPA to Percentage Calculator
- Highest Salary Engineering Stream
- 15 Top Career Options After Engineering
- 6 Top Career Options After BBA
- Job Market and Interview Preparation
- Why Should You Be Hired: 5 Answers
- Top 10 Future Career Options
- Top 15 Highest Paid IT Jobs India
- 5 Common Guesstimate Interview Q&A
- Average CEO Salary: Top Paid CEOs
- Career Options in Political Science
- Top 15 Highest Paying Non-IT Jobs
- Cover Letter Examples for Jobs
- Top 5 Highest Paying Freelance Jobs
- Top 10 Highest Paying Companies India
- Career Options and Paths After MBA
- 20 Best Careers After B.Com
- Career Options After MBA Marketing
- Top 14 Careers After MBA In HR
- Top 10 Highest Paying HR Jobs India
- How to Become an Investment Banker
- Career Options After MBA - High Paying
- Scope of MBA in Operations Management
- Best MBA for Working Professionals India
- MBA After BA - Is It Right For You?
- Best Online MBA Courses India
- MBA Project Ideas and Topics
- 11 Exciting MBA HR Project Ideas
- Top 15 MBA Project Ideas
- 18 Exciting MBA Marketing Projects
- MBA Project Ideas: Consumer Behavior
- What is Brand Management?
- What is Holistic Marketing?
- What is Green Marketing?
- Intro to Organizational Behavior Model
- Tech Skills Every MBA Should Learn
- Most Demanding Short Term Courses MBA
- MBA Salary, Resume, and Skills
- MBA Salary in India
- HR Salary in India
- Investment Banker Salary India
- MBA Resume Samples
- Sample SOP for MBA
- Sample SOP for Internship
- 7 Ways MBA Helps Your Career
- Must-have Skills in Sales Career
- 8 Skills MBA Helps You Improve
- Top 20+ SAP FICO Interview Q&A
- MBA Specializations and Comparative Guides
- Why MBA After B.Tech? 5 Reasons
- How to Answer 'Why MBA After Engineering?'
- Why MBA in Finance
- MBA After BSc: 10 Reasons
- Which MBA Specialization to choose?
- Top 10 MBA Specializations
- MBA vs Masters: Which to Choose?
- Benefits of MBA After CA
- 5 Steps to Management Consultant
- 37 Must-Read HR Interview Q&A
- Fundamentals and Theories of Management
- What is Management? Objectives & Functions
- Nature and Scope of Management
- Decision Making in Management
- Management Process: Definition & Functions
- Importance of Management
- What are Motivation Theories?
- Tools of Financial Statement Analysis
- Negotiation Skills: Definition & Benefits
- Career Development in HRM
- Top 20 Must-Have HRM Policies
- Project and Supply Chain Management
- Top 20 Project Management Case Studies
- 10 Innovative Supply Chain Projects
- Latest Management Project Topics
- 10 Project Management Project Ideas
- 6 Types of Supply Chain Models
- Top 10 Advantages of SCM
- Top 10 Supply Chain Books
- What is Project Description?
- Top 10 Project Management Companies
- Best Project Management Courses Online
- Salaries and Career Paths in Management
- Project Manager Salary in India
- Average Product Manager Salary India
- Supply Chain Management Salary India
- Salary After BBA in India
- PGDM Salary in India
- Top 7 Career Options in Management
- CSPO Certification Cost
- Why Choose Product Management?
- Product Management in Pharma
- Product Design in Operations Management
- Industry-Specific Management and Case Studies
- Amazon Business Case Study
- Service Delivery Manager Job
- Product Management Examples
- Product Management in Automobiles
- Product Management in Banking
- Sample SOP for Business Management
- Video Game Design Components
- Top 5 Business Courses India
- Free Management Online Course
- SCM Interview Q&A
- Fundamentals and Types of Law
- Acceptance in Contract Law
- Offer in Contract Law
- 9 Types of Evidence
- Types of Law in India
- Introduction to Contract Law
- Negotiable Instrument Act
- Corporate Tax Basics
- Intellectual Property Law
- Workmen Compensation Explained
- Lawyer vs Advocate Difference
- Law Education and Courses
- LLM Subjects & Syllabus
- Corporate Law Subjects
- LLM Course Duration
- Top 10 Online LLM Courses
- Online LLM Degree
- Step-by-Step Guide to Studying Law
- Top 5 Law Books to Read
- Why Legal Studies?
- Pursuing a Career in Law
- How to Become Lawyer in India
- Career Options and Salaries in Law
- Career Options in Law India
- Corporate Lawyer Salary India
- How To Become a Corporate Lawyer
- Career in Law: Starting, Salary
- Career Opportunities: Corporate Law
- Business Lawyer: Role & Salary Info
- Average Lawyer Salary India
- Top Career Options for Lawyers
- Types of Lawyers in India
- Steps to Become SC Lawyer in India
- Tutorials
- C Tutorials
- Recursion in C: Fibonacci Series
- Checking String Palindromes in C
- Prime Number Program in C
- Implementing Square Root in C
- Matrix Multiplication in C
- Understanding Double Data Type
- Factorial of a Number in C
- Structure of a C Program
- Building a Calculator Program in C
- Compiling C Programs on Linux
- Java Tutorials
- Handling String Input in Java
- Determining Even and Odd Numbers
- Prime Number Checker
- Sorting a String
- User-Defined Exceptions
- Understanding the Thread Life Cycle
- Swapping Two Numbers
- Using Final Classes
- Area of a Triangle
- Skills
- Software Engineering
- JavaScript
- Data Structure
- React.js
- Core Java
- Node.js
- Blockchain
- SQL
- Full stack development
- Devops
- NFT
- BigData
- Cyber Security
- Cloud Computing
- Database Design with MySQL
- Cryptocurrency
- Python
- Digital Marketings
- Advertising
- Influencer Marketing
- Search Engine Optimization
- Performance Marketing
- Search Engine Marketing
- Email Marketing
- Content Marketing
- Social Media Marketing
- Display Advertising
- Marketing Analytics
- Web Analytics
- Affiliate Marketing
- MBA
- MBA in Finance
- MBA in HR
- MBA in Marketing
- MBA in Business Analytics
- MBA in Operations Management
- MBA in International Business
- MBA in Information Technology
- MBA in Healthcare Management
- MBA In General Management
- MBA in Agriculture
- MBA in Supply Chain Management
- MBA in Entrepreneurship
- MBA in Project Management
- Management Program
- Consumer Behaviour
- Supply Chain Management
- Financial Analytics
- Introduction to Fintech
- Introduction to HR Analytics
- Fundamentals of Communication
- Art of Effective Communication
- Introduction to Research Methodology
- Mastering Sales Technique
- Business Communication
- Fundamentals of Journalism
- Economics Masterclass
- Free Courses
MVC Page Life Cycle Explained in Simple Language
Updated on 17 November, 2022
9.28K+ views
• 13 min read
Table of Contents
- Application life cycle
- The request life cycle
- UrlRoutingModule
- How is the request matched with those routes present in the MVC application through the UrlRoutingModule?
- How are the routes in the RouteHandler defined?
- RouteHandler
- MvcHandler
- ControllerFactory
- Controller
- ActionInvoker
- ActionResult
- ViewEngine
- Benefits of Using Page Life Cycle of MVC
- Conclusions
This article will focus on the lifecycle of the MVC application and how the application processes a request through its passing through the application’s components. Two life cycles are present in an MVC life cycle. These two life cycles are:
- The application life cycle
- The request life cycle.
Check out our free courses to get an edge over the competition
Application life cycle
Application life cycle generally means the time at which the process of the application begins to run. To denote the MVC application life cycle, the start and the end of the application are marked.
Check out upGrad’s Advanced Certification in Cloud Computing
The request life cycle
The request life cycle means the series of events that happen whenever the application handles an HTTP request. Routing is the entry point for beginning any application of the MVC. When a request is made to the ASP.NET platform, the decision is taken on how to handle the request through the routing module. The term module means components of .NET, which are used for adding functionality into the code. It is the responsibility of the routing modules to match the URL that is incoming to the respective routes defined in the application. A route handler is associated with every route, which marks the point of entry into the framework of MVC.
The framework of MVC is responsible for handling the conversion of the route data into controllers that will further handle the requests. Once the creation of the Controller is done, the next step is taking action. This is done through the component of action invoker, which selects an action method to invoke the Controller.
Explore Our Software Development Free Courses
Check out upGrad’s Advanced Certification in Cyber Security
Once the preparation for the action result is done, the next step is the result execution. A step of separation is created for the result from the result execution. For a view type result, the application will call the view engine, and it will find and help in rendering the view. If the result is not a view, execution of the action will take place on its own. It is the result execution that generates the actual response towards the original HTTP request.
Most of the components are known by the developers that they are used to process the request. In most cases, the methods and controllers related to the actions are being worked upon. Also, different action results and views are being worked upon. But there are other components too within the framework of MVC. There might be many questions in one’s mind about how the flow of requests is carried out through the different components or the HTTP module role and the handler while processing the request. The MVC framework being a framework of web development, there have to be modules of the HHTP and the HTTP handlers in the MVC pipeline of the framework.
Many components are present in the MVC page life cycle, apart from the Controller and the action methods.
UrlRoutingModule
This is the start of an MVC life cycle.This is a type of HTTP module. Whenever a request is first made, it is intercepted through the UrlRoutingModule. In this module, it is being decided upon whether the MVC application should handle the request. The UrlRoutingModule selects the first route that matches.
Learn Software Development Courses online from the World’s top Universities. Earn Executive PG Programs, Advanced Certificate Programs or Masters Programs to fast-track your career.
How is the request matched with those routes present in the MVC application through the UrlRoutingModule?
Looking at the method of RegisterRoutes, which is called from global.asax, the routes added to the RouteCollection of the routes could be seen. Calling of the method is done from the event handler at the application_start of global.asax. This is a very important part of the MCV page life cycle.
Explore our Popular Software Engineering Courses
How are the routes in the RouteHandler defined?
The routes are defined as extension methods, as it could be seen in the method of the maproute. The route handler is associated with all routes.
The method of the UrlRoutingModule is defined in the following way.
Through the above explanation, it can be known that the UrlRoutingModule knows all the routes that are defined in the application. Therefore, the correct route can be matched with the request in the application.
An important point to be noted is that the module UrlRoutingModule is involved in selecting the first matching route. So whenever the match has been detected, the process of scanning stops. If we summarize the thing that happens at this stage, the route handler is attached to the routes through the URLRoutingModule.
upGrad’s Exclusive Software Development Webinar for you –
SAAS Business – What is So Different?
RouteHandler
Through the method of the maproute, the routes get attached to the instances of the MvcRouteHandler. The interface IRouteHandler is implemented through the MvcRouteHandler.
Therefore, the object of the MvcRouteHandler is used for obtaining a reference for the thing of the MvcRouteHandler that is the application’s HTTPHandler.
Creation of the MvcRouteHandler, demands the calling of the method PostResolveRequestCache(). This method PostResolveRequestCache() can be defined in the following way:
Therefore, the following events occur at the PostResolveRequestCache() method.
- A GetRouteData() method is present in the RouteCollection property. The method is called and passed through the HttpContext.
- RouteData object is returned through the method of GetRouteData().
- a RouteHandler property is contained by the routeData that returns the handler IRouteHandler for the request, which is current, i.e., the MvcRouteHandler.
- The method GetHttpHandler() is associated with the MvcRouteHandler that returns a reference for the MvcHandler.
- Controls are then delegated to the instance of MvcHandler.
In-Demand Software Development Skills
MvcHandler
The MvcHandler is a normal handler of the HTTP. It is a very important part of the MVC life cycle. As it is a handler of the HTTP, the implementation of the method ProcessRequest() is carried out. This method ProcessRequest() can be defined as:
The method ProcessRequest() is used for calling the method ProcessRequestInit() as defined in the below image:
Source
The following events occur at the method ProcessRequest().
- The ControllerFactory is created through the calling of the method ProcessRequestInit().
- The ControllerFactory creates the Controller.
- The Execute() method of the Controller’s is called.
ControllerFactory
One can observe that the ControllerFactory is obtained through the ProcessRequest() method. The ControllerFactory is then used to create the object of the Controller object. The interface IControllerFactory is implemented by the Controller factory. This is a major step in the life cycle of MVC.
BY DEFAULT, the MVC framework creates the type DefaultControllerFactory type when the ControllerBuilder is used for creating the ControllerFactory.
The following line of code creates the ControllerFactory in the method ProcessRequestInit().
Controller
It has been observed that the Controller object is created in the ControllerFactory in the method ProcessRequest() of the MvcHandler. The created Controller contains the methods for the actions that are to be taken by the framework. Whenever a request of URL is made in the browser, there is a calling of the method for the actions. The controllers are created so that there is no explicit implementation of the interface of the IControlle. The class Controller is used for creating the controllers that provide several features. The class of Controller can inherit another class of Controller which is called the “ControllerBase” as defined in the code shown below:
The ActionInvoker is used to call the methods of the actions in the Controller. It is one of the components of the MVC page life cycle.
The following events occur after the creation of the Controller through the controller factory:
- Calling the method Execute() of controllerbase.
- The method ExecuteCore()is called by the method Execute() that is declared as abstract and is then defined through the class Controller.
- The action name is retrieved from the RouteData through the method ExecuteCore() by the class Controller.
- The method ActionInvoker’s InvokeAction() is called by the method ExecuteCore().
ActionInvoker
It is used for the selection of actions.
The class ActionInvoker has some important responsibilities that include finding an action method and then invoking the method of action in the Controller.
The events that occur when the method ActionInvoker’s InvokeAction() is called are:
- The information regarding the Controller has to be obtained by the ActionInvoker and the action that is needed to perform.
- The descriptor object’s provides this information.
- The controller name and the action name are provided by the descriptor class of the action and Controller.
- There is invoking the ActionMethod .
ActionResult
The ActionResult is a type of the abstract class. Being an abstract method, there are different implementations for the method ExecuteResult() provided by the different sub-classes.
The following events occurs in the ActionResult
- There is an invocation of the methods of OnActionExecuting of the ActionFilters.
- Invoking of the method action.
- Invoking of the methods OnActionExecuted methods of ActionFilters.
- There is a return of the ActionResult from the ActionMethod
- Calling the method ExecuteResult() of the ActionResult.
ViewEngine
Most of the applications use ViewResult as their return type. A view is rendered through the ViewEngine to the client. From this view, the HTML can be generated. The HTML is generated from the view through the ViewEngine.
Benefits of Using Page Life Cycle of MVC
The life cycle of MVC and its usage comes with many benefits. This is an important page life cycle in MVC that can be used to develop website applications more efficiently. Let’s check out a few benefits of MVC page life cycle.
- Assembling large applications – It is incredibly simple to split and arrange the content on web apps into a wide range of applications due to the three layers of code separation (generally managed by larger developer teams). The main benefit of employing such coding conventions is that they make adding new features easier and discovering certain areas of code easily.
- AMI or Asynchronous Method Invocation is supported – It is not surprising that the MVC design enables the usage of (AMI), enabling developers to create web-based applications that execute more quickly, given how effectively JavaScript and its libraries integrate with it. It implies that MVC apps may be configured to function with site-specific browsers, PDF files, and desktop applications as well.
- Simple planning and upkeep – The MVC paradigm is beneficial during the early planning stages of the application since it provides the developer with a roadmap on how to organize their concepts into application code. Additionally, it is a fantastic tool for reducing code duplication and simplifying application management.
- The development process is faster- Since the code is divided into three layers, creating web applications using the MVC model enables two developers to work on different sections of the program simultaneously, such as the view and controller. This makes applying logic simple and helps double the development process speed. The MVC paradigm has resulted in a fast turnaround speed compared to other agile practices.
- A platform that Supports SEO – The MVC framework offers tremendous assistance for the creation of web applications that support SEO. The page life cycle in MVC offers a simple method for creating RESTful URLs that are SEO-friendly in order to increase traffic from a certain application.
- Encourages test-driven development – The MVC pattern has the significant benefit of greatly streamlining the testing procedure. Large-scale programs can be more easily debugged since the application’s numerous tiers are well defined architecturally and appropriately structured. hence making the use of unit tests during application development simple.
- Provides data that is not formatted – The MVC framework gives you the ability to build your own view engine by delivering data that is not structured. For instance, you can format any sort of data using HTML; however, with an MVC model, you can also format the data using the Macromedia Flash or Dream viewer. The fact that identical elements may be used with either interface is advantageous for developers.
- Different viewpoints – The MVC design makes it simple to create several view elements for your modeling framework. It gives you the ability to create several view components, preventing code duplication by separating data from logic.
- Simple to Modify – The MVC technique makes it simple to transform the entire app. The MVC pattern streamlines the process of adding and modifying new types of views. Therefore, changes made to one part of the app will never change the architecture as a whole. As a result, the application’s adaptability and durability will be improved.
Read our Popular Articles related to Software
Conclusions
Understanding the role of every component in the application is a crucial step. This way, the connections between the components and their way of working can be understood. If you want to be an experienced developer, then mastering your skills is one way. You can check out the Online Software Engineering Courses of upGrad which will give you certification and expert training in the area of developing applications and software. The course is designed for both male and female working professionals and is certified from IIIT-B, and you will get their Alumni Status.
Frequently Asked Questions (FAQs)
1. Can you explain the page life cycle of MVC?
When MVC is applied, the application is divided into three layers: Data layer or Model, UI or View and Controller. Each layer of MVC has a different function. First, The UI or View layer is the user interface. It is the main interface between the users and the application. It is responsible for receiving user input and presenting the results. Then the controller is connected to all the components in the view layer, and it processes user input, sends data to the model layer, and sends the result back to the user. The model layer is where data is stored. It is responsible for controlling the data. In addition, a model layer is also responsible for reading and writing data to storage.
2. How can we maintain sessions in MVC?
The ASP.NET MVC framework utilizes the power of the ASP.NET Session State. The session state is a web service that is built in to the ASP.NET platform. It is responsible for maintaining all of the objects, data and other information that is associated with a given session. The SessionState object maintains the values of the session state. It is also responsible for populating and maintaining the values of the Session object. The Session object acts as the gateway to the session state. It is a property of the SessionState object and is what is used to store and retrieve the values for the session state.
3. How many types of filters are there in MVC?
The filters in MVC are the ones that sit between the controller and the model and can be used to validate user input or modify the output of the model. The following are some of the filters in MVC. 1. Validation filters - Validation filters help to validate user input. 2. Action filters - Action filters help to modify the outputs of the model. 3. Model filters - Model filters help to modify the outputs of the model. 4. Output filters - Output filters are used to modify the output of the model.
RELATED PROGRAMS