开发者

Does Razor needs MVC3 or can I use it only with .NET?

开发者 https://www.devze.com 2023-03-25 23:15 出处:网络
I am newbie for template engines Just I am curious is it possible to use Razor without MVC ? I want to use a template 开发者_Python百科engine in .NET. I have looked at the NVelocity but razor seems mo

I am newbie for template engines Just I am curious is it possible to use Razor without MVC ? I want to use a template 开发者_Python百科engine in .NET. I have looked at the NVelocity but razor seems more understandable to me


Well, not really. Razor view engine is built on top of ASP.Net but it doesn't depend on MVC framework.

You can use it in a console app if you wish.

Here's a good article demonstrating the use outside of MVC: http://buildstarted.com/2010/09/29/razor-view-engine-without-mvc-at-all/

and another one here from Andrew Nurse: http://vibrantcode.com/blog/2010/7/22/using-the-razor-parser-outside-of-aspnet.html


You can check out RazorEngine:

A templating engine built upon Microsoft's Razor parsing technology. The RazorEngine allows you to use Razor syntax to build robust templates

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号