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

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

Keine News gefunden!