Antaris/RazorEngine — Issue #29: @Html (HtmlHelper instance) cannot be resolved
Author: scottnickel
Created: 2012-02-23 21:18:14+00:00
State: open

I am trying to call various @Html helper methods and the template will not compile saying:

"Unable to compile template. The name 'Html' does not exist in the current context"

Use a very simple template like this:

string template = "@using System.Web.Mvc @Html.Raw(\"some html stuf\f")";
Razor.Parse(template);

I added an instance of HtmlHelper to ViewBag and accessed the .Raw() method through there, but it still HtmlEncodes the output.

Thanks,

Scott