When calling LoadFromString, LoadFromStream, LoadFromFile, LoadTemplateClassFromFile, LoadTemplateClassFromStream, LoadTemplateClassFromString, Run and UltimateTemplateEngine constructor, you should consider to catch the exceptions listed below:
Example below shows how to handle these exceptions:
using System; using ComponentPro; ... TemplateEngine dt = new TemplateEngine(); try { dt.LoadFromFile("Template.tpl"); } catch (TemplateEngineException exc) { Console.WriteLine(exc.Message); return; } string output = dt.Run(); Console.WriteLine(output);