I've searched a lot for "How to change the title programatically" and only got this result which doesn't work, at least in Razor scripts
DotNetNuke.Framework.CDefault tp = (DotNetNuke.Framework.CDefault)this.Page;
tp.Title = "New Title Here";
This doesn't work in razor host scripts, is there any other solutions to change the page title from Razor host script ?
I'd just like to add to Pola's answer with something that will hopefully work "out of the box".
It's hard to find examples that work directly with DNN, so I submit the following;
This is the only way working for me:
After many trials and merging others codes, I've found the solution
Using this will give you access to the page access, so you can do whatever you want with it, changing title etc.
And this code will give access to the DNN Page, So you can insert controls etc.