Pages Html

NuGet packageOwin.Framework.Pages.Html
GitHub sourceOwinFramework.Pages.Html

Home |  Readme

[PageTitle] attribute | The OWIN Framework Pages

The [PageTitle] Attribute

The [PageTitle] attribute can only be attached to a class that defines a page to specify the page title. When your page is displayed in a browser, the title will be displayed on the browser tab.

If you want your page title to be dynamic, because your page handles multiple Urls, then you should inherit from the built-in Page class and set the [PageTitle] property in the constructor as illustrated below:


This is an example of how to add page with a dynamic page title

")] internal class DynamicTitlePage : Page { public DynamicTitlePage(IPageDependenciesFactory dependencies) : base(dependencies) { TitleFunc = context => "Page at " + DateTime.Now; } }

The [PageTitle()] attribute has the following properties you can set.


Defines the title for the page. To calculate the page title dynamically, see the Page element documentation.