私は数日前にNHamlを発見しましたが、それは素晴らしいプロジェクトです。
Html.LabelFor()、Html.TextBoxFor( )などのMVC2Htmlヘルパーを使用しようとすると; ビューはコンパイルされません。
例:
error CS1061: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'LabelFor' and no extension method 'LabelFor' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)
0185: textWriter.Write(" ");
0185: textWriter.Write(Convert.ToString(Html.LabelFor(model => model.Username)));
0187: textWriter.WriteLine();
error CS1061: '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?)
0194: textWriter.Write(" ");
0194: textWriter.Write(Convert.ToString(Html.TextBoxFor(model => model.Username)));
0196: textWriter.WriteLine();
nhamlのWeb.configセクションにアセンブリと名前空間を追加しようとしましたが、何も変更されません。
私が使用している:
- System.Web.Mvc 2.0
- .NET Framework 3.5 SP1
- gitトランクからのNhaml1.5.0.2(および他のビルドを試しました)
私のNHaml構成は次のとおりです。
<nhaml autoRecompile="true" templateCompiler="CSharp3" encodeHtml="false" useTabs="false" indentSize="2">