X
dnn.blog.
Back

Changing the module title / hiding the module

Sometimes you need to change the title of your container, perhaps because you show a special product and want to have the product name as title or something like that. Another reason is localization of module titles.

Localize your module title

You can localize your module title with a special entry in the corresponding resource file. The mask for this is:

ControlTitle_.Text

For example:ControlTitle_.Text, ControlTitle_edit.Text, ControlTitle_settings.Text, ...

Important! The ControlKey must be written in lowercase !

Changing module title in Codebehind

You can change the module title to whatever you want when you use this code snippet:

Control ctrl = Globals.FindControlRecursiveDown(this.ContainerControl, "lblTitle");
if (ctrl != null)
{
    ((Label)ctrl).Text = “New title”;
}

Important ! You have to insert this in Page_PreRender !

Hiding the module container

If you want to hide the complete module for some circumstances (e.g. if not logged in as admin) you can use

protected void Page_PreRender(object sender, System.EventArgs e)
{
	this.ContainerControl.Visible = false;
}
Back
Total: 2 Comment(s)
Abbey Monger
Change of the module is become easy for those people who want to do it without hiring of outer services. If you are looking for online https://www.essayontime.co.uk/">best essay writing service for your works then read reviews from official sites.
Thursday, September 6, 2018 · reply ·
Trace
For sure, I will keep this advice in mind from now on. I will make sure to write about it on https://australianwritings.net/ as well. It's just so that more people can be made aware of this technique.
Wednesday, November 14, 2018 · reply ·

about.me.

Torsten WeggenMy name is Torsten Weggen and I am CEO of indisoftware GmbH in Hanover, Germany. I'm into DNN since 2008. Before this, I did a lot of desktop stuff mainly coded with Visual Foxpro (see http://www.auktionsbuddy.de). 

I'm programmer, husband, father + born in 1965.

Please feel free to contact me if you have questions.

Latest Posts

DNN module development with Angular 2+ (Part 7)
6/10/2018 1:43 PM | Torsten Weggen
DNN module development with AngularJS (Part 6)
12/16/2016 7:00 AM | Torsten Weggen
DNN module development with AngularJS (Part 5)
12/16/2016 6:00 AM | Torsten Weggen
DNN module development with AngularJS (Part 4)
12/16/2016 5:00 AM | Torsten Weggen
DNN module development with AngularJS (Part 3)
12/16/2016 4:00 AM | Torsten Weggen
DNN module development with AngularJS (Part 2)
12/16/2016 3:00 AM | Torsten Weggen
DNN module development with AngularJS (Part 1)
12/15/2016 7:19 AM | Torsten Weggen
Blogging in DNN with Markdown Monster by Rick Strahl
11/27/2016 1:14 PM | Torsten Weggen
Creating a global token engine
11/18/2016 10:25 AM | Torsten Weggen
DnnImagehandler - Hot or not ?
2/21/2015 11:52 PM | Torsten Weggen

My Twitter

Torsten Weggen 3/17/2019

You can make a real difference in Abir ’s life. Join me on @Kiva https://t.co/NlCTgIAZAN

Torsten Weggen 2/2/2019

As a freelance developer I often get invites from headhunters. This one should be very interesting... https://t.co/CNrEXBTBuJ

Torsten Weggen 10/11/2018

Evernote or OneDrive user and love #markdown #markdownmonster ? Take a look at Joplin! https://t.co/4bzkiD6CHn