RazorLight icon indicating copy to clipboard operation
RazorLight copied to clipboard

Inject page to @RenderBody programmatically

Open bretbas opened this issue 1 year ago • 3 comments

Hi all. Im new in RazorLight, so don't throw tomatoes) I have a several templates with pages in db. Each template consists of string Layout (cshtml with @RenderBody) and several pages (with ViewContent cshtml).

I want to collect Layout with needed page (ViewContent), but i don't know how. So, i want to inject ViewContent of the page to Layout (@RenderBody)

var layout = await engine.CompileRenderAsync(template.Layout, (dynamic?)null);
var viewContent = await engine.CompileRenderAsync(page.ViewContent, (dynamic?)null);

How can i to do this?

bretbas avatar May 14 '23 22:05 bretbas

I have the same problem

devopsalexandr avatar May 15 '23 20:05 devopsalexandr

Enybody knows how to do that or not? This lib can help?

bretbas avatar May 16 '23 17:05 bretbas

Is the project alive or not?

bretbas avatar May 19 '23 15:05 bretbas