I believe the problem isn't within the view itself. I'm not familiar NancyFX engine, but all engines views should be using a base view. The default is in the web.config in the views folder:
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
Of course you're not using razor, this is simply a comparison where Html
exists on System.Web.Mvc.WebViewPage
. How you configure NancyFX, the configuration needs to define the one that supports the HtmlHelpers
(that either come with MVC or NancyFX, I'm not sure).
After taking a look at Gibhub It looks very similar:
<system.web.webPages.razor>
<pages pageBaseType="Nancy.ViewEngines.Razor.NancyRazorViewBase">
And the NancyRazorViewBase
has HtmlHelpers
on it so it sounds very much like a configuration issue.