Skip to main content
  MVC – Project Templates

Templates in ASP.NET MVC
·         While creating new project in MVC by selecting "ASP.NET MVC 4 Web Application" we will get different project templates to select those are Empty template, Basic Template, Internet Application template, Intranet Application template, Mobile Application template and Web API templates.
·         We will learn what these templates in asp.net MVC are and which template we need to select to create new project in asp.net MVC? by creating simple asp.net MVC web application.
·         For creating new application open visual studio (Here we are using visual studio 2013) and From Start page select File à New à  Project.

·         After that a new dialog will pop up from that select Template a Visual C# a Web. In project select ASP.NET MVC 5 Web Application and enter Name of Project “MVCProjectTemplates” after this just click on OK button like as shown following image
Empty Template in MVC
·         The Empty template contains basic empty MVC folder structure with Global.asax file and App_Start folder at top and it will not contain Script folder and Content folder.
·         This is just empty configuration from here you all need to create application.
Basic Template in MVC
·         The basic template comes with MVC folder structure which is Model Folder, Controller Folder and View folder are empty but View folder has a Shared Folder in which it contains Layouts.cshtml and Error.cshtml.
·         The basic template will contain Script folder with default script files and Content folder will have themes and site.css style sheet inside it.
Internet Application Template in MVC
·         The Internet Application Template comes with MVC folder structure which contains default HomeController and AccountController with default View for both controller and AccountModels which is required for registration.
·         It also comes with Basic Login and registration Mechanism built in it. It is completely ready application for development.
Web API Application Template in MVC
·         The Web API Application is yet another version of Internet application template which comes with default Home and Value controller with default View for Home controller and Value controller inherits from ApiController.
·         It is used for creating HTTP based RESTful web services. Web API Template is mostly use for passing data to various clients (Mobile and tablet). If you want to create quickly web based Service then Web API is best choice for it.


Comments

Popular posts from this blog

Top 10 ASP.NET Web API Interview Questions

What is ASP.NET Web API? ASP.NET Web API is a framework that simplifies building HTTP services for broader range of clients (including browsers as well as mobile devices) on top of .NET Framework. Using ASP.NET Web API, we can create non-SOAP based services like plain XML or JSON strings, etc. with many other advantages including: Create resource-oriented services using the full features of HTTP Exposing services to a variety of clients easily like browsers or mobile devices, etc. What are the Advantages of Using ASP.NET Web API? Using ASP.NET Web API has a number of advantages, but core of the advantages are: It works the HTTP way using standard HTTP verbs like  GET ,  POST ,  PUT ,  DELETE , etc. for all CRUD operations Complete support for routing Response generated in JSON or XML format using  MediaTypeFormatter It has the ability to be hosted in IIS as well as self-host outside of IIS Supports Model binding and Validation Support for OD...

First, FirstOrDefault, Single, SingleOrDefault In C#

For people who are new to LINQ, it is difficult to understand the difference between First, FirstOrDefault, Single, SingleOrDefault. In this blog, I will explain what to use and when.     I will take a simple example to make you understand practically how these methods work.   Consider a class Employee with properties as Id, Name, and Department. class  Employee {    public   int  Id {  get ;  set ; }    public   string  Name {  get ;  set ; }    public   string  Department{  get ;  set ; } } I have a list of Employees: List<Employee> employeeList =  new  List<Employee>(){    new  Employee() { Id = 1, Name =  "Sunny" , Department =  "Technical"  },    new  Employee() { Id=2, Name= "Pinki" , Department = "HR" },    new  Employee() { Id=3, Name= "Tensy" , De...

Extension methods in C#

Consider the class C# 1 2 3 4 5 6 7 8 9 10 11 12 13          namespace ExtensionMethod      {          public class testClass {              public string sayHello ( ) {              return "Hello" ;            }        }      }     Invoke the above from your form using C# 1 2 3 4 5 6          testClass test = new testClass ( ) ;      MessageBox . Show ( test . sayHello ( ) ) ;     This will show “Hello” in message box. Consider the scenario where you don...