Spark view engine and ASP.NET MVC 2 strongly Typed Html Helpers

Posted by dekko on Stack Overflow See other posts from Stack Overflow or by dekko
Published on 2010-05-21T16:48:18Z Indexed on 2010/05/21 16:50 UTC
Read the original article Hit count: 872

Filed under:
|
|

Hi.
I try to use HtmlHelper.TextBoxFor with spark view engine but view crashed with exception "Dynamic view compilation failed. 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'TextBoxFor' and no extension method 'TextBoxFor' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)".

It is my _global.spark:

<use namespace="System"/>
<use namespace="System.Linq"/>
<use namespace="System.Text" />
<use namespace="System.Web.Mvc"/>
<use namespace="System.Web.Mvc.Html"/>
<use namespace="System.Web.Routing"/>
<use namespace="System.Linq.Expressions" />
<use namespace="MyModels" />

In spark-view using: ${Html.TextBoxFor(m => m.UserName)}

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about mvc