Thursday, February 5, 2009

How to change in code the title of web page in Dotnetnuke based website?

In the ordinal web page to change programmatically the title of the .aspx page is simple:


protected void Page_Load(object sender, EventArgs e)
{
this.Title = "The ordinal web page";
}


In dotnetnuke's module that code will not help. The title of the web page will be created by DNN's core.

But we can solve this problem. The code below shows how to achieve this:


protected void Page_Load(object sender, EventArgs e)
{
DotNetNuke.Framework.CDefault page = (DotNetNuke.Framework.CDefault)this.Page;
page.Title = "Веб-страница в Dotnetnuke";
}



You can see here how it works.

No comments: