using NVelocity.App;
using NVelocity.Runtime;
using NVelocity;
VelocityEngine vltEngine = new VelocityEngine();
vltEngine.SetProperty(RuntimeConstants.RESOURCE_LOADER, "file");
vltEngine.SetProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, System.Web.Hosting.HostingEnvironment.MapPath("~/templates"));
vltEngine.Init();
VelocityContext vltContext = new VelocityContext();
vltContext.Put("username", "");
vltContext.Put("password", "");
vltContext.Put("msg","");
Template vltTemplate = vltEngine.GetTemplate("login.htm");
System.IO.StringWriter vltWrite = new System.IO.StringWriter();
vltTemplate.Merge(vltContext, vltWrite);
string html = vltWrite.GetStringBuilder().ToString();
context.Response.Write(html);