nvelocity

NVelocity ASP.NET Examples

a 夏天 提交于 2019-12-04 16:19:50
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

Does NVelocity no longer support string templates?

纵然是瞬间 提交于 2019-12-03 07:58:26
问题 We have a bunch of NVelocity templates in embedded resources that we use for emails. We want to move these templates to the DB so they can be configured easily by users. It seems though that NVelocity (Castle port) doesn't support strings as templates. Does anyone know how to do it. To be clear this is what I want to do (syntax may be inaccurate, I'm going by memory) ... string templateString = "Hello $!user"; Template template = new Template(templateString); string results = template.Merge(.

Is the NVelocity project dead? Are there alternatives?

偶尔善良 提交于 2019-12-01 02:07:11
I'm looking for a template engine for .NET/C# to generate email notifications in my application. I read about NVelocity in the past and think it would fit my needs, but it seems this project is dead. Would you still recommended to use NVelocity for that purpose or can you suggest any alternatives? Note: I found some other templating engines, but these are mostly "view-engines" for ASP.NET MVC (Brail, NHaml, etc.). But I think these are not what I'm looking for. Pervez Choudhury The Castle Project forked the project and have been maintaining it, and most recently released version 1.1.1 on 10

NVelocity extension method ASP.NET webform

a 夏天 提交于 2019-12-01 01:45:45
I was wondering if it's possible to use an extension method with asp.net webforms and nvelocity. I would like to set some defaults if the string value is null or empty. Example of .vm file: Example of my email body... Billable Status: $billableStatus.Evaluate() rest of my email body... Attempted extension method: public static class Helper { public static string Evaluate(this string value) { if (String.IsNullOrEmpty(value)) return "Not Provided"; else return value; } } Or is there an alternative to what I'm tryting to accomplish? I don't think NVelocity can resolve extension methods with C#/VB

Is the NVelocity project dead? Are there alternatives?

老子叫甜甜 提交于 2019-11-30 21:33:23
问题 I'm looking for a template engine for .NET/C# to generate email notifications in my application. I read about NVelocity in the past and think it would fit my needs, but it seems this project is dead. Would you still recommended to use NVelocity for that purpose or can you suggest any alternatives? Note: I found some other templating engines, but these are mostly "view-engines" for ASP.NET MVC (Brail, NHaml, etc.). But I think these are not what I'm looking for. 回答1: The Castle Project forked

NVelocity extension method ASP.NET webform

故事扮演 提交于 2019-11-30 21:13:46
问题 I was wondering if it's possible to use an extension method with asp.net webforms and nvelocity. I would like to set some defaults if the string value is null or empty. Example of .vm file: Example of my email body... Billable Status: $billableStatus.Evaluate() rest of my email body... Attempted extension method: public static class Helper { public static string Evaluate(this string value) { if (String.IsNullOrEmpty(value)) return "Not Provided"; else return value; } } Or is there an