Learn .Net Training from the Best Tutors
Search in
In ASP.NET MVC (Model-View-Controller) framework, various methods and classes are used to implement the architecture effectively. Here are some key components in ASP.NET MVC and their purposes:
Controllers:
Controller
Class: In MVC, controllers handle user input and update the model accordingly. Controllers are classes that inherit from the Controller
class provided by the framework. They contain methods (actions) that handle HTTP requests. Actions are responsible for processing user input, interacting with the model, and returning the appropriate view.Models:
Model
Class: The model represents the application's data and business logic. In ASP.NET MVC, models are often plain C# or VB.NET classes that encapsulate the data and behavior of the application. These classes are used to interact with the database or any other data source.ViewModel
Class: In addition to the model, ViewModels are used to shape the data specifically for views. They are used to provide a clean separation between the view and the model, allowing the view to display only the data it needs.Views:
View
Class: Views are responsible for presenting the user interface. They are typically written in Razor syntax (in ASP.NET MVC) and contain HTML markup mixed with C# or VB.NET code to display data from the model. Views use a combination of HTML helpers and Razor syntax to generate dynamic content.Routing:
RouteConfig
Class: The RouteConfig
class is used to define URL patterns and map them to the appropriate controller and action. It is configured in the RouteConfig.cs
file in the App_Start
folder. Routing is crucial in MVC to determine which controller and action should handle a specific URL.Helpers and Utilities:
UrlHelper
Class: This class provides methods for generating URLs within the application. It helps in creating links to actions or resources based on the route configuration.Filters:
Filter
Classes (e.g., AuthorizeAttribute
, ActionFilterAttribute
): Filters are used to perform actions before or after the execution of an action method. For example, the AuthorizeAttribute
can be applied to control access to specific actions or controllers.Action Results:
ActionResult
Class and its derived classes (e.g., ViewResult
, JsonResult
): Action results are returned by action methods to define the response sent to the client. For example, a ViewResult
is used to render a view, and a JsonResult
is used to return JSON data.These are just a few key components, and there are many other classes and features in ASP.NET MVC that provide additional functionality and help in building scalable, maintainable, and testable web applications. The MVC pattern promotes the separation of concerns, making it easier to manage and extend different parts of the application.
Related Questions
Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com
Ask a QuestionRecommended Articles
Learn Hadoop and Big Data
Hadoop is a framework which has been developed for organizing and analysing big chunks of data for a business. Suppose you have a file larger than your system’s storage capacity and you can’t store it. Hadoop helps in storing bigger files than what could be stored on one particular server. You can therefore store very,...
Top 5 Skills Every Software Developer Must have
Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today. In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...
What is Applications Engineering all about?
Applications engineering is a hot trend in the current IT market. An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...
8 Hottest IT Careers of 2014!
Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...
Looking for .Net Training ?
Learn from the Best Tutors on UrbanPro
Are you a Tutor or Training Institute?
Join UrbanPro Today to find students near youThe best tutors for .Net Training Classes are on UrbanPro
The best Tutors for .Net Training Classes are on UrbanPro