Working with generated classes in the MVC application

This page is a part of a tutorial, which you should follow sequentially, from the beginning to the end. Go to the first page: Getting started with Kentico.

To use the generated wrapper classes of your page types (e.g., Home.generated.cs and HomeProvider.generated.cs) in the development of your tutorial website, you need to copy them from the Kentico project to your MedioMVC application. 

  1. Locate the six classes you have generated in your Kentico project files.

    By default, the classes are stored in: \CMS\App_Code\CMSClasses\Pages\MEDIO, which translates into, e.g., C:\inetpub\wwwroot\Kentico11\CMS\App_Code\CMSClasses\Pages\MEDIO, in the file system. If you have installed Kentico as a web application, the files are stored in \CMS\Old_App_Code\CMSClasses\Pages\MEDIO, e.g., C:\inetpub\wwwroot\Kentico11\CMS\Old_App_Code\CMSClasses\Pages\MEDIO in the project files.

  2. Open your MedioMVC project folder in, e.g., Windows Explorer, and create a new Generated folder under your Models folder, e.g., C:\inetpub\wwwroot\MedioMVC\MedioMVC\Models\Generated.

  3. Copy the classes that represent your page types to the Generated folder.

  4. Open your MedioMVCapplication in Visual Studio andselect the MedioMVCproject.

  5. Click the Show all files button to see the files you have copied in the solution.

  6. Select the classes, right-click to open the context menu, and select Include In Project.

  7. Build your solution.

You have added the classes generated for your page types to the MedioMVC application. This will allow you to retrieve the page content from the database and design its presentation on the live site.

Previous page: Adding content only pages to the MVC site — Next page: Creating the website layout

Completed pages: 6 of 10

ΟΟΟΟΟΟΟΟΟO