Closed adoconnection closed 2 years ago
@benmccallum I moved your last comment to a new issue. Please drop a line if the problem is solved or not.
Thanks @adoconnection , sorry for piling on another issue :P
I've resolved my issue, but should we get my gist into a sample app or documentation so this combo is clear to setup for folks?
Gosh, sorry I'm not sure how I missed the extensions part of the readme which points to: https://github.com/wdcossey/RazorEngineCore.Extensions
Perhaps I should've just used that all along 🤦🏻♂️
No worries
Feel free to close this if you'd prefer to point to the other package. Here's my gist again for anyone it helps.
👌👌
@adoconnection , I seem to have a problem after following the layout + html safe templating docs whereby the
@RenderBody()
portion is html encoded... any suggestions?It's like it's encoding the
@RenderBody()
part when it's already safe/encoded.Edit: I think I have a solution, shout out if I'm missing any issues though.
MyTemplateBase<T>
Include and RenderBody methods to returnobject
and be virtual.MyHtmlTemplateBase<T>
(which inheritsMyTemplateBase<T>
) by overriding those two methods and have themreturn Raw(base.Include/RenderBody);
.internal class
as it was previously private inside MyTemplateBase.Like this, when
WriteAsync
is called with the RenderBody() or Include() result, it's already aRawContent
and the avoidance of html encoding happens.Hope that helps someone else. Almost wonder if it's worth adding this into the docs.
Originally posted by @benmccallum in https://github.com/adoconnection/RazorEngineCore/issues/65#issuecomment-954703223