How to use NHaml in MVC 4?

爱⌒轻易说出口 提交于 2019-12-11 03:28:09

问题


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());

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...


回答1:


Remove any old versions you have and install this one:

https://github.com/NHaml/NHaml

Then, add this line:

ViewEngines.Engines.Add(new NHaml.Web.Mvc3.NHamlMvcViewEngine())


来源:https://stackoverflow.com/questions/24126053/how-to-use-nhaml-in-mvc-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!