· Chris Hammond
Last Updated
DotNetNuke Tip: How to modify the page title with your module
Learn how to easily change the page title in your modules with this simple C# trick. Customize titles based on admin preferences with this code snippet!
This is actually a very simple trick to do inside of your modules, though you might need to setup an option to allow this to be turned on or off depending on what the site administrator wants the page title to be.
In C# you can use the following code
DotNetNuke.Framework.CDefault tp = (DotNetNuke.Framework.CDefault)this.Page;
tp.Title = "This is my page title";
So the next time you're coding a module and need to change the page title, it's that simple.