Briefly explain to me different templates that are used in MVC with example.
Explain different templates in MVC?
38630-Jan-2020
Updated on 30-Jan-2020
Home / DeveloperSection / Forums / Explain different templates in MVC?
Briefly explain to me different templates that are used in MVC with example.
Nishi Tiwari
30-Jan-2020Templates in Asp.Net MVC
When we create a new project in MVC by selecting "ASP.NET MVC 4 Web Applications" we will get different project templates and select those templates according to our requirement.
Empty Template in MVC
The Empty template contains only a basic empty MVC folder structure with Global.asax file and App_Start folder at the top and it will not contain any Script folder and Content folder. This is just an empty configuration from here we all need to create an application. In case if we select Empty Template for the project our folder structure will like below:
Basic Template in MVC
The basic template comes with the MVC folder structure which is a Model Folder, Controller Folder and View folder which are empty but View folder has a Shared Folder in it which contains Layouts.cshtml and Error.cshtml. The basic template will contain the Script folder with the default script files and the Content folder will contain themes and site.css style sheet inside it. If we select a basic template for our project, the folder structure will show below
Internet Application Template in MVC
The Internet Application Template comes with an MVC folder structure that contains default HomeController and AccountController with default View for both these controllers and AccountModels which will be required for registration. It also comes with the Basic Login and registration Mechanism built within it. It is completely ready application for the development. If we select internet application template for the project our folder structure like as shown below
Intranet Application Template in MVC
The Intranet Application Template is a bit similar to the Internet application Template. It has a default Home controller with related View within it. It mainly comes with built-in windows based authentication mechanism. By using this Template we can develop an application for intranet-based systems. If we select the intranet application folder template for a project our folder structure will show like below
Mobile Application Template in MVC
The Mobile Application Template is mostly similar to the Internet application template that comes with default Home and Account controller with default View for both these controllers. Mobile application templates also come with login and registration mechanisms. DotNetOpenAuth references for an external log in functionality is removed from it. If we select mobile application template for the project then folder structure will show like below
Web API Application Template in MVC
The Web API Application is another version of the Internet application template that comes with default Home and Value controller and also with default View for Home controller and Value controller which inherits from ApiController.It is used to create HTTP based RESTful web services. Web API Template is widely used for passing data to various clients (Mobile and tablet). If we want to create a quickly web-based Service then Web API will be the best choice for it. If we select the Web API application template for the project then our folder structure will show like below