Question

Am trying to render markdown views into my master page aka 'Layout.cshtml'. So far I got my solution to render the markdown using my own view engine and view.

I'd like to to keep the master page, 'Layout.cshtml', rendering with razor for dynamic navigation etc. and only pass it the parsed contents from my markdown in RenderBody() or else.

What I am missing is a hook for the master page in e.g. IView's Render(...) method to get my contents in ... :/

How to get views from the custom view engine to render in the razor view engine's master page?

P.S. using ServiceStack is not an option atm :)

Was it helpful?

Solution

Rethinking the approach it seems easier to use only the controller to glue all information together and keep the razor view engine as is and do not add in a separate view engine for the above purpose.

The solution now has the markdown files within Content/Markdown/... and the controller maps and gets the markdown per request and returns the markup resulting from parsing it back into a view model which is then used to render in a typed view.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top