因为要将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 : 实现我们自己的视图引擎 .

相关类及接口:

Autumn Park is QBlog the official site, created by the passing autumn, based on the framework developed cyqdata data layer supports multiple users, multiple languages, multiple databases(access,mssql,oracle), directory level url and other powerful blog system
http://kb.cnblogs.com/page/88326/