• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 361
  • Last Modified:

Razor: What else besides Layout can be assigned in _ViewState.cshtml?

Placing the following _ViewState.cshtml file in a View folder means any Razor file in the folder will have a Layout value of _Layout.cshtml.

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}

What else can be included in the _ViewState.cshtml file beside Layout?
0
newbieweb
Asked:
newbieweb
  • 2
1 Solution
 
gery128Commented:
you can include some very common information that you may want to keep in view. e.g. common header or footer or something like that.
0
 
newbiewebAuthor Commented:
Can you give me an example of the syntax for a header?
0
 
newbiewebAuthor Commented:
Thanks.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now