NVelocity ASP.NET Examples

Posted by Ben on Stack Overflow See other posts from Stack Overflow or by Ben
Published on 2010-03-17T11:10:47Z Indexed on 2010/03/20 23:31 UTC
Read the original article Hit count: 607

Filed under:
|

I'm looking to use NVelocity in my ASP.NET MVC application, not as a view engine, just for rendering some email templates.

However, I cannot for the life of me get it to work. I have downloaded it from the castle project and followed the example at http://www.castleproject.org/others/nvelocity/usingit.html#step1

No matter what I try I don't seem to be able to load a template located in my site. The example suggests using the absolute path, which I have tried to no avail:

Template t = engine.GetTemplate("/Templates/TestEmail.vm");

So please can someone give me two examples. One of loading a template located in the web site directory and secondly one parsing a string variable (as it is likely that my templates will be stored in a database).

Many thanks Ben

© Stack Overflow or respective owner

Related posts about nvelocity

Related posts about ASP.NET