Razor.Parse(template, model); is not working

Dec 26, 2015 at 9:36 AM
Below code is not working
I have created HtmlTemplateBase class and model class with name, email and copy paste the below i am getting error. error CS1061: 'System.Web.Mvc.HtmlHelper<MvcApplication5.Controllers.PageModel>' does not contain a definition for 'TextBoxFor' and no extension method 'TextBoxFor' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<MvcApplication5.Controllers.PageModel>' could be found (are you missing a using directive or an assembly reference?)}

please help me

Razor.SetTemplateBase(typeof(HtmlTemplateBase<>));

string template =
@"<html>
  <head>
    <title>Hello @Model.Name</title>
  </head>
  <body>
    Email: @Html.TextBoxFor(m => m.Email)
  </body>
</html>";
var model = new PageModel { Name = "World", Email = "someone@somewhere.com" };
string result = Razor.Parse(template, model);