NuGet package | Owin.Framework.Pages.Html |
GitHub source | OwinFramework.Pages.Html |
Attach this attribute to a class to identify it as a webpage. To register this page with the router and send requests to it you must get the fluent builder to scan the assembly containing your class.
[IsPage] [Route("/", Method.Get)] [UsesLayout("homePageLayout")] internal class HomePage { }
var fluentBuilder = ninject.Get<IFluentBuilder>(); fluentBuilder.Register(Assembly.GetExecutingAssembly(), t => ninject.Get(t));
The [IsPage()] attribute has the following properties you can set.
You do not have to choose a name for your page, but it makes sense to do so for debugging purposes.
If there is more than one URL that returns this page's content, then you are strongly advised to set the CanonicalUrl property. This tells search engines that you deliberately made more than one URL for the page and tells the search engine which one to direct trafic to.
If you have multiple URLs for a page and do not set the CanonicalUrl property then the page rank will be significantly reduced by the search engines.