HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In
GitHubNuGetDev CommunityDoc feedback

Given that there is a page model registered like:

You can have several templates defined for the same typed page. The following example registers two templates for the same typed page.

  • One is `StandardTemplate` without tags which will be the default template to use when rendering page instances of type `TypedPage`.

  • The other template is another generic template for all pages that is more suitable for rendering for mobile devices.

To change the template that is used for a request, you can attach an event handler to an event that is raised when a template is chosen for a specific request. The following code sample attaches to the event and changes the template for request for `TypedPage` instances when the request comes from a mobile device.