5.4. Creating a Project

The Following topics will show how to use the Visual Studio wizards to create the framework of an MVC.NET application.

Open File New Project in Visual Studio 2015 and create a new project named FBMVCExample.

fbdevgd30 mvc 002 en

Figure 30. Create the FBMVCExample project

fbdevgd30 mvc 003 en

Figure 31. Change authentication setting

For now, we will create a web application with no authentication, so click the Change Authentication button to disable authentication. We will get back to this issue a bit later.

fbdevgd30 mvc 004 en

Figure 32. Disable authentication for now

5.4.1. Structure of the Project

The project that you create will have virtually no functionality, but it already has its basic structure, described briefly in the following table:

Table 6. Basic Structure of the MVC Project
Folder or FilePurpose

/App_Data folder

Where private web application data, such as XML files or database files, are located.

/App_Start folder

Contains some main configuration settings for the project, including the definitions of routes and filters.

/Content folder

Static content goes in here, such as CSS files and images. It is an optional convention. You can store CSS files anywhere you want.

/Controllers folder

Controller classes are saved here. It is an optional convention. You can store controller classes anywhere.

/Models folder

View model and business model classes are saved here although it is better for all applications (except for the simplest ones) to define a business model in a separate project. It is an optional convention. You can store model classes anywhere you like.

/Scripts folder

Stores the JavaScript libraries being used in the application. By default, Visual Studio adds jQuery libraries and several other popular JavaScript libraries. It is an optional convention.

/Views folder

Stores the views and partial views. They are commonly grouped together in sub-folders name for the controllers they are connected with.

/Views/Shared subfolder

Stores layouts and views not specific to one controller.

/Views/Web.config file

Contains the configuration information that ensures that views are processed within ASP.NET and not by the IIS web server. Also contains the namespaces imported into views by default.

/Global.asax file

The global class of an ASP.NET application. A configuration for a route is registered in the file with its code (Global.asax.cs). Also contains also any code that is supposed to be executed during the launch or termination of an application or when an unhandled exception arises.

/Web.config file

The configuration file for the application.

5.4.2. Adding the Missing Packages

We will use the NuGet package manager to add the missing packages:

  • FirebirdSql.Data.FirebirdClient

  • EntityFramework (automatically added by the wizard)

  • EntityFramework.Firebird

  • Bootstrap (automatically added by the wizard)

  • jQuery (automatically added by the wizard)

  • jQuery.UI.Combined

  • Respond (automatically added by the wizard)

  • Newtonsoft.Json

  • Moderninzr (automatically added by the wizard)

  • Trirand.jqGrid

Not all packages provided by NuGet are the latest version of the libraries. It is especially true for JavaScript libraries. You can install the latest versions of JavaScript libraries using a content delivery network (CDN) or by just downloading them and replacing the libraries provided by NuGet.

Right-click the project name in Solution Explorer and select the Manage NuGet Packages item in the drop-down menu.

fbdevgd30 mvc 005 en

Figure 33. Select Manage NuGet Packages

Find and install the necessary packages in the package manager.

fbdevgd30 mvc 006 en

Figure 34. Select packages for installing