views:

92

answers:

1

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)}

+1  A: 

I use the newest version of spark. I found what was wrong. I miss to add model type in view.

<viewdata model=MyModel"/>
dekko