using @helper syntax (see http://weblogs.asp.net/scottgu/archive/2011/05/12/asp-net-mvc-3-and-the-helper-syntax-within-razor.aspx) generates the appropriate code-behind and adding a reference to System.Web.WebPages fixes half of the problem. That leaves the fact that the generated helper method calls WriteTo(TextWriter, object) which doesn't exist in RazorTemplateBase. Adding a method with the correct will fix this - it should have the same effect as RazorTemplateBase.Write() but on the TextWriter.
↧