I’m building ASP.NET Core application, and have a requirement that some pages (not for all pages), will be generated on the fly from fragments. Fragments will be stored in database and include pieces of JavaScript and HTML code. The fragments should be inserted in certain places, and there must be a way to pass parameters to the fragments.
HTML page
<div class="row">
@insert_fragment_with_parameters(fragmentId = 1, parameters: {day:”Friday”}
)
…
Fragment 1
<h2>Good morning. Today is @insert_parameter(day) </h2>
…
Fragment 2
…
I have a feeling that I’m inverting a wheel here. Is there any notation/library/framework to achieve this fast and easy?