Create pages and controls

The DotVVM Command Line tool can create new pages, master pages, or markup controls in ASP.NET Core projects.

Creating pages, master pages, and controls is suported only in ASP.NET Core projects using the new project system. For .NET Framework projects, we recommend using Visual Studio.

Supported commands

Task Short Syntax Long Syntax Options
Create Page dotnet dotvvm ap dotnet dotvvm add page
  • {PageName} - name of the page or path of the `.dothtml` file
  • -m {MasterPage} - (optional) name or path of the master page
Create Master Page dotnet dotvvm am dotnet dotvvm add master
  • {PageName} - name of the page or path of the `.dotmaster` file
Create Markup Control dotnet dotvvm ac dotnet dotvvm add control
  • {ControlName} - name of the control or path of the `.dotcontrol` file
  • -c - (optional) create a code-behind file for the control

Example

  1. Create the Views/Site.dotmaster master page:
dotnet dotvvm add master Site
  1. Create the Views/Page1.dothtml page and embed it in the Views/Site.dotmaster:
dotnet dotvvm add page Page1 -m Site
  1. Create the Controls/MyControl.dotcontrol user control with the code behind file:
dotnet dotvvm add control Controls/MyControl.dotcontrol -c

See also