Search code examples
sitecoresitecore8glass-mapper

Runtime Error on 'Editable' when using Glass.Mapper in Sitecore8.1


I have Sitecore8.1 MVC with Glass.Mapper.Sc package (from NuGet) installed. I need to use the 'Editable' method in my cshtml, but I keep getting a runtime error:

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

Do I need other DLLs, or usings or config updates etc..?


Solution

  • You have to use it in a Controller Rendering and not a View Rendering. Its in the Glass.Mapper.Sc.Web.Mvc.GlassView class. See this link for a working example.

    http://www.seanholmesby.com/sitecore-mvc-page-editor-friendly-views-with-glass-mapper/