#2 Set <base> tag in header
Set <base> Tag in Header using the IPageService
This page sets the Base tag in the header. Look at the source of this page to see the result.
There are two ways to do this:
Kit.Page.SetBase()
will auto-detect the current base. It's extra smart, so the result will also work on the home page of a portal.Kit.Page.SetBase("/some/page")
create the base tag with the specified url.
Output is Invisible as it only affects the HTML Head
This sample modifies the HTML head, so it's not visible here.
To see the effect, look at the source in the browser
Kit.Page gets the Page Service on newer Razors
This tutorial inherits from the Custom.Hybrid.Razor14
or the Custom.Hybrid.RazorTyped
base class.
This allows us to use Kit.Page
to access an IPageService
without having to use GetService<IPageService>
.
#2 Set <base> tag in header