编辑NVelocity View Engine to Asp.net Mvc
因为要将CHSNS#转到Asp.net MVC平台上来,所以就有了在Asp.net Mvc平台下NVelocity的引擎问题
MvcContrib虽然也有NVelocity的引擎,不过整体错误不少.还必需要Castle.Windsor来动态引入ViewEngine
怎么看都不爽,于是自写了一个NVelocityEngine.
Download CHSNS NVelocity ViewEngine you'll write the follow in Global:
C#:
public void Application_Start(object sender, EventArgs e) {
ControllerBuilder.Current.SetControllerFactory(typeof(NVelocityEngine.NVelocityControllerFactory));
}
这样就可以直接使用它了
实现方法和lulu的文章是基本一致的:
ASP.NET MVC : 实现我们自己的视图引擎 .相关类及接口:
*
IViewDataContainer
*
IViewEngine
*
IViewLocator
*
WebFormViewEngine
*
ViewLocator
o
WebFormViewLocator