Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject page to @RenderBody programmatically #524

Open
bretbas opened this issue May 14, 2023 · 3 comments
Open

Inject page to @RenderBody programmatically #524

bretbas opened this issue May 14, 2023 · 3 comments

Comments

@bretbas
Copy link

bretbas commented May 14, 2023

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?

@devopsalexandr
Copy link

I have the same problem

@bretbas
Copy link
Author

bretbas commented May 16, 2023

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

@bretbas
Copy link
Author

bretbas commented May 19, 2023

Is the project alive or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants