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;
}