The parts after that are parameters to the method. The controller is a class and the action is a method on that class. These routes define what happens when your application receives a request. public static void RegisterRoutes( RouteCollection routes) It’s got a really important method called RegisterRoutes where you define your routes. There are a couple of very important things to notice in an ASP.NET MVC framework project.įirst, look at the Global.asax and it’s code behind. I started out creating an ASP.NET MVC Web Application called PhotoGalleryMVC. ![]() Simple enough? Creating the ASP.NET MVC Framework Project It handles the end user interaction, manipulates the data in the model and decides which view to return to the user. “Controllers” are responsible for the actual logic. Most of the time, these displays/responses are built based on model data. Typically this is HTML but it could be XML, JSON or any other number types of display/service response. “Views” are responsible for the actual user interface. In our demo below we’re actually going to just be reading in an XML file from the disk. Most of the time, this will be an ORM such as the Entity Framework, NHibernate or SubSonic. However, it can work with any data access type that returns a set of objects that the view can access. ![]() By default the ASP.NET MVC framework uses the Entity Framework. The model could be over an XML file or whatever other data store that you happen to use. ![]() The data is often times in a database but it doesn’t have to be. “Models” are responsible for the the data access. MVC architecture divides the responsibilities of an application into three main components – models, views, and controllers. NET with the principles of the MVC architecture behind it. In this post, I’ll walk you through the process of creating this simple photo gallery with the MVC framework.įirst, let’s talk a little about what the ASP.NET MVC framework is. It takes less time to build than the “Hello World” did back in the day. The fun part is that this level of application is really the new “Hello World”. I decided to create a simple photo gallery in the ASP.NET MVC framework.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |