Reputation: 762
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..?
Upvotes: 1
Views: 1077
Reputation: 714
Use @Html.Glass().Editable()
. The HTML helper was introduced in 4.0.0.4. It allows you to skip inheriting from GlassView<T>
and works with both controller and view renderings.
Upvotes: 7
Reputation: 1435
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/
Upvotes: 0