Pass data through to cshtml rendered by Umbraco.RenderTemplateAsync()
I have tried with ViewData and VewBag, neither work.
Is there a way to pass a series of variables (or even a class containing the data) through to the resulting CSHTML executed when RenderTemplateAsync is used?
(Just to clarify, this is to render email content)
If you can get a HttpContext, you can add them in the Items collection in there, and retrieve them in your view. That is what I used to do in FullTextSearch.
I went ahead and created a service object that was scope-based and used Dependency Injection to do it. Seems to be working good; I was hoping that I was just missing something :-)
Pass data through to cshtml rendered by Umbraco.RenderTemplateAsync()
I have tried with ViewData and VewBag, neither work.
Is there a way to pass a series of variables (or even a class containing the data) through to the resulting CSHTML executed when RenderTemplateAsync is used?
(Just to clarify, this is to render email content)
Hi John
If you can get a HttpContext, you can add them in the Items collection in there, and retrieve them in your view. That is what I used to do in FullTextSearch.
Thanks.
I went ahead and created a service object that was scope-based and used Dependency Injection to do it. Seems to be working good; I was hoping that I was just missing something :-)
is working on a reply...