Anonymous or Substitute Handlers
Last updated
//UriMapping.MappingUriPrefix - a constant, equals to "/sc/mapping"
model.Menu = Self.GET(UriMapping.MappingUriPrefix + "/menu", () => new Page());UriMapping.Map("/Products/menu", UriMapping.MappingUriPrefix + "/menu");// The IndexPage is available for view composition.
// It is retrieved with a request.
Handle.GET("/my-app", () => new IndexPage());Handle.GET("/my-app", () => new MasterPage()
{
// The IndexPage is not available for view composition.
// It is retrieved without a request.
CurrentPage = new IndexPage()
});// The MasterPage and the IndexPage are both retrieved
// with a request and available for view composition.
Handle.GET("/my-app", () => MasterPage()
{
CurrentPage = Self.GET("/my-app/partials/index")
});
Handle.GET("/my-app/partials/index", () => new IndexPage());// The IndexPage is still available for view composition,
// It is retrieved with an anonymous request.
Handle.GET("/my-app", () => MasterPage()
{
CurrentPage = Self.GET("/my-app/partials", () => new IndexPage())
});