The name 'layout' does not exist in the current context

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Hi,
I'm trying to write new plugin for "payment transfer notification form".
I getting this error in all created view .cshtml files.

@{
    Layout = "";
}
@model Nop.Plugin.Payments.HavaleBildirimFormu.Models.VirtualPosModel
@using Nop.Web.Framework;
<table width="100%" cellspacing="2" cellpadding="1" border="0">
    <tr>
...

The "Layout" is red underlined and showing "The name 'layout' does not exist in the current context" error. What mean of this error?
10 years ago
Hey, i am facing the same problem in creation of my plugin.

If you have found the solution then please tell me.
10 years ago
Hi guys, any thoughts on this? I'm getting the same problem too.
9 years ago
I have the same problem, even with existing plugins and a fresh download of the latest (3.40) version of nopCommerce.
All is fine in the web application views, but in the plugins I get that error.
I tried to reference System.Web.Mvc directly, but it says that Mvc is not part of the System.Web namespace.
All seems to work OK when the applicaiton is running, but it would be good to get rid of the error and get my intellisense back.
I am using Visual Studio 2012.
5 years ago
Add this to your project file:

<PropertyGroup>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
</PropertyGroup>


It transforms your project to a web project.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.