Trying to Register a Partial Using Handlebars.RegisterTemplate("content",content); and getting the error HandlebarsDotNet.HandlebarsRuntimeException: Referenced partial name content could not be resolved
My Code
varhandlebars=Handlebars.Create();handlebars.Configuration.UseJson();stringemail_skeleton=File.ReadAllText($"{AppContext.BaseDirectory}/templates/EmailSkeleton.html");Handlebars.RegisterTemplate("content",content);vartemplate=handlebars.Compile(email_skeleton);stringtemp=template(objects);returntemp;email_skeleton
<tablealign="center" border="0" cellpadding="0" cellspacing="0" width="100%"
style="border-collapse:collapse;margin:0 auto; padding:0; max-width:600px"><tbody><tr><tdalign="center" valign="center" style="text-align:center; padding: 40px"><ahref="http://methodcorp.com" rel="noopener" target="_blank"><imgalt="Logo"
src="http://methodcorp.com/wp-content/uploads/2021/04/Method_logo_sticky-300x87-1.png?x76110" /></a></td></tr><tr><tdalign="left" valign="center">
{{> content}}
</td></tr><tr><tdalign="center" valign="center"
style="font-size: 13px; text-align:center;padding: 20px; color: #6d6e7c;"><p></p></td></tr></tbody></table>content
<divstyle="padding-bottom: 30px"><span>Dear {{user.name}}</span></div><divstyle="padding-bottom:30px"><span>The following Objective {{obj.objective_name}} has been createed</span></div><divstyle="padding-bottom:30px"><span>You Can View the Created Objective in the following Link:</span></div><divstyle="padding-bottom: 40px; text-align:center;"></div>Stuff I tried
- added the partial inside a block
{{#test}}{{/test}} resulted in a empty content and added test as an object
<tablealign="center" border="0" cellpadding="0" cellspacing="0" width="100%"
style="border-collapse:collapse;margin:0 auto; padding:0; max-width:600px"><tbody><tr><tdalign="center" valign="center" style="text-align:center; padding: 40px"><ahref="http://methodcorp.com" rel="noopener" target="_blank"><imgalt="Logo"
src="http://methodcorp.com/wp-content/uploads/2021/04/Method_logo_sticky-300x87-1.png?x76110" /></a></td></tr><tr><tdalign="left" valign="center"></td></tr><tr><tdalign="center" valign="center"
style="font-size: 13px; text-align:center;padding: 20px; color: #6d6e7c;"><p></p></td></tr></tbody></table>
- Ive read in the issues about the partial block
{{#>content}}ites empty{{/content}} but this didnt work either it failes to the content inside the block
Trying to Register a Partial Using
Handlebars.RegisterTemplate("content",content);and getting the errorHandlebarsDotNet.HandlebarsRuntimeException: Referenced partial name content could not be resolvedMy Code
email_skeleton
content
Stuff I tried
{{#test}}{{/test}}resulted in a empty content and added test as an object{{#>content}}ites empty{{/content}}but this didnt work either it failes to the content inside the block