Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

$4.95 Windows Hosting at Webhost4life.com
  Ads  
 


  Sponsors  

Meet Our Sponsors

SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Setting the page title from within a module
Previous Previous
 
Next Next
New Post 6/29/2007 2:48 AM
User is offline Matthew Barr
23 posts
www.miitube.co.uk/
10th Ranked


Setting the page title from within a module 

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 7:18 AM
User is offline Wolverine
144 posts
9th Ranked


Re: Setting the page title from within a module 

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 5:15 AM
User is offline Matthew Barr
23 posts
www.miitube.co.uk/
10th Ranked


Re: Setting the page title from within a module 

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 10:33 AM
User is offline dnninstalled
82 posts
10th Ranked


Re: Setting the page title from within a module 

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 2:21 AM
User is offline Matthew Barr
23 posts
www.miitube.co.uk/
10th Ranked


Re: Setting the page title from within a module 

This works - excellent, thank you!

Matt

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Setting the page title from within a module
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Ultra Media Gallery & Video Gallery
The most popular photo gallery and video gallery module. with Flash interface.
www.bizmodules.net
WDK Solutions
Quality modules for the DotNetNuke community. Check out our 'wild' modules!
wdkns.com
UK - DotNetNuke providers
UK providers of DNN module development and skin package design. Oxford Information Labs provides cost-effective solutions for businesses and organisations specialising in Skin design and bespoke module development.
www.oxil.co.uk

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP