Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions input/guide/content-and-data/template-languages/razor.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ Because Statiq uses a custom Razor base page, the Razor Intellisense engine does
@inherits StatiqRazorPage<IDocument>
```

Additionally, if you're using JetBrains Rider or ReSharper, update the `Sdk` attribute of your `.csproj` file to `Microsoft.NET.Sdk.Web` as shown below.

```
<Project Sdk="Microsoft.NET.Sdk.Web">
```

## View Imports Model

**Important note:** if you do create a `_ViewImports.cshtml` file, it will also instruct the Statiq Razor engine during generation. Generally this isn't a problem since the file is just reiterating what Statiq is doing behind the scenes. However, if any of your partial views change the model with a `@model` directive, the `@inherits` directive in the `_ViewImports.cshtml` file will take precedence and the model you define in the partial view will not work. In this case you should define your partial model using a full `@inherits` directive. For example, `@model int` should become `@inherits StatiqRazorPage<int>`.
Expand Down