I am using RazorEngine to render out some basic content (a very crude content management system).
It works great until I include any @Html syntax into markup.
If the markup contains an @html I get the following error:
Unable to compile template. The name 'Html' does not exist in the
current context
This is the view that renders the markup:
@Model Models.ContentPage
@{
ViewBag.Title = Model.MetaTitle;
Layout = "~/Views/Shared/Templates/_" + Model.Layout + "Layout.cshtml";
}
@Html.Raw(RazorEngine.Razor.Parse(Model.Markup, Model))
I have seen on the Codeplex site for RazorEngine the use of @Html (I know the version on there is out of date and I got my version via nuget).
Any help on this would be great.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…