Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Setting the page title from within a moduleSetting the page title from within a module
Previous
 
Next
New Post
6/29/2007 4:48 AM
 

Hi,

Is it possible to programmatically chnage the tite of a page (i.e. the title that appears between the page's <title></title> tags) from within a module on a page? Or is it too late to set the page title by the time a module is loaded? Obvious attempts such as adding the following don't seem to work:

Page.Title = productInfo.ProductTitle; 

I've tried adding in calls to the parent object before the Page but I suspect this isn't going ot be possible. Can anyone confirm this?

Thanks,

Matt

 
New Post
6/29/2007 9:18 AM
 

Did you try putting the assignment in the "Page_Init" method?  Since that runs before anything else you might get a better result...just a guess though...you code should work, but obviously the DNN page is overriding it.

 
New Post
7/2/2007 7:15 AM
 

Still no luck, I'm afraid. I suspect this would require changes to the Default.aspx.vb file in the Core code, which isn't ideal if you want to stay on an upgrade path. Bit of a limitation if you want search engine friendly pages with meaningful titles.

 
New Post
7/2/2007 12:33 PM
 

I may be misunderstanding here, but to change the title programmatically in your own module:

VB
Dim myPage As DotNetNuke.Framework.CDefault
myPage = CType(Me.Page, CDefault)
myPage.Title = "This is the new title"

C#
DotNetNuke.Framework.CDefault myPage = new DotNetNuke.Framework.CDefault();
myPage = (CDefault)this.Page;
myPage.Title = "This is the new title";

I was able to make this work even after another module changed the title (the login module). The code above was swiped from signin.ascx.vb

 
New Post
7/3/2007 4:21 AM
 

This works - excellent, thank you!

Matt

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Setting the page title from within a moduleSetting the page title from within a module


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out