Quantcast
Channel: My Errors & My Solutions
Viewing all articles
Browse latest Browse all 123

The name ‘DisplayModes’ does not exist in the current context

$
0
0

My Errors & My Solutions My Errors & My Solutions - It Could Happen To You

The name ‘DisplayModes’ does not exist in the current context

The error above is caused from the following code:

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

Solution:

Replace

DisplayModes.RequireConsistentDisplayMode = true;

with

DisplayModeProvider.Instance.RequireConsistentDisplayMode = true;

Did my solution solve your problem? Leave a reply.

The name ‘DisplayModes’ does not exist in the current context


Viewing all articles
Browse latest Browse all 123

Trending Articles