I followed the Glass tutorial (http://glass.lu/docs/tutorial/sitecore/tutorial14/tutorial14.html) to get Page Editor working with Glass and Sitecore MVC.
I have a basic View Rendering which shows up fine when I have basic HTML and Sitecore Helper Methods in it.
<div>
@Html.Sitecore().Field("Title")
</div>
The moment I go to convert this to a GlassView, I get the following exception:-
The view at '/Views/Layouts/SampleContent.cshtml' must derive from WebViewPage, or WebViewPage.
Here is my View:-
@inherits Glass.Mapper.Sc.Web.Mvc.GlassView<TestMVCContent.Sample_Item>
<div>
@Editable(x => x.Title)
</div>
I am running Sitecore 7.1 - Update-1, and have installed both the Glass.Mapper.Sc.Mvc-4 and Glass.Mapper.Sc.CastleWindsor Nuget packages.
Here is part of the web.config inside my Views folder.
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="Sitecore.Mvc" />
<add namespace="Sitecore.Mvc.Presentation" />
</namespaces>
</pages>
</system.web.webPages.razor>
I can see GlassView inherits from WebViewPage....so I don't know why it's not working. Is there something I need to register in my Views to get this working?
Thanks.