因为要将CHSNS#转到Asp.net MVC平台上来,所以就有了在Asp.net Mvc平台下NVelocity的引擎问题

MvcContrib虽然也有NVelocity的引擎,不过整体错误不少.还必需要Castle.Windsor来动态引入ViewEngine

 

怎么看都不爽,于是自写了一个NVelocityEngine.

下载及源码:CHSNS NVelocity View Engine

 

使用方法为:

public void Application_Start(object sender, EventArgs e) {
         ControllerBuilder.Current.SetControllerFactory(
typeof(NVelocityEngine.NVelocityControllerFactory));
}

这样就可以直接使用它了


实现方法和lulu的文章是基本一致的:ASP.NET MVC : 实现我们自己的视图引擎 .

 

相关类及接口:

 

相关文章:

  • 2021-10-09
  • 2021-08-05
  • 2022-12-23
  • 2021-12-05
  • 2021-07-30
猜你喜欢
  • 2021-09-29
  • 2021-07-02
  • 2021-06-05
  • 2021-07-02
  • 2022-12-23
  • 2021-12-03
  • 2021-12-11
相关资源
相似解决方案