#1 Reuse Code and Razor Templates
Reuse Code and Razor Templates
This will show you how to place partial templates into separate files, and how to put functions you need in many places in separate files as well. It focuses on:
@Html.Partial(...)
to render another page (older versions of 2sxc used @RenderPage(...)
) - see docs
Func<dynamic, dynamic>
micro-helpers are ideal for small sub-templates - see docs
When Using other Razor or Code, you should also know:
MyModel
is the object used in sub-pages to receive parameters from the caller - see docs
GetCode(...)
to create objects from .cs files - see docs
#1 Reuse Code and Razor Templates