问题描述
我已经使用HAML在Ruby on Rails的,我发现了一个HAML版本的.Net叫NHaml,我累了搜索如何在Web应用程序中实现NHaml,我读了这篇文章:但我不能完成的步骤,因为我有一个错误与此行
I have used haml in Ruby on Rails, and I found a haml version in .Net called NHaml, I am tired to search how to implement NHaml in a web application, I read this article: http://weblogs.asp.net/stephenwalther/asp-net-mvc-tip-35-use-the-nhaml-view-engine but I can't complete the steps because I have an error with this line
ControllerBuilder.Current.SetControllerFactory(new NHamlControllerFactory());
我认为本教程是一个旧版本,我需要使用HTML的MVC 4,我真的不知道,如果这个项目是死的,因为我查到的资料是2011年,2010年,2009年...
I think that the tutorial is for a old version, I need to use Html in MVC 4, really I don't know if the project is dead, because the information that I found is of 2011, 2010, 2009...
推荐答案
删除您有任何旧版本并安装这一个:
Remove any old versions you have and install this one:
https://github.com/NHaml/NHaml
然后,加入这一行:
ViewEngines.Engines.Add(new NHaml.Web.Mvc3.NHamlMvcViewEngine())
这篇关于如何在MVC 4使用NHaml?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!