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

Posted on 2011-10-18
Last Modified: 2012-05-12
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?
Question by:newbieweb
    LVL 9

    Accepted Solution

    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.

    Author Comment

    Can you give me an example of the syntax for a header?

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now