Register | Login
Friday, July 04, 2008

Sections
  
About Us
  
Hosting Provided by Server Intellect
Partners
Downloads
  
 WWWCoder.com Resource Directory

 

ORDER TODAY!
Professional DotNetNuke ASP.NET Portals
Amazon.com now has the only DotNetNuke book you'll ever need. Written by the guys who brought you DotNetNuke, Shaun Walker, Patrick Santry, Joe Brinkman, Dan Caron, Scott McCulloch, Scott Willhite, and Bruce Hopkins. Order it now! .

Modifying the Title Tag in DNN
9/24/2004 8:50:20 AM

This is a core mod. In some cases you may need to modify the title tag. For example, in the newsgroup module here on WWWCoder.com, it is all on one single tab, but we wanted to change the title to the newsgroup subject in order to optimize the site for spiders like Google. In this code snip we provide you with a tutorial on how to modify the core code to enable title tag modifications.

First modify the Default.aspx file so the title tag becomes a control:



<TITLE id="PageTitle" runat="server"></TITLE>


Then in the code behind for the Default.aspx file add the following (about line 257):



CType(Me.FindControl("PageTitle"), HtmlGenericControl).InnerText = strTitle


Then in your module code, whenever you want to change the title tag add something like the following:



Try
If Not Page.FindControl("PageTitle") Is Nothing Then
CType(Page.FindControl("PageTitle"), _
HtmlGenericControl).InnerText = MyValue
End If
Catch ex As Exception

End Try


This should now change the title tag to match the headline of the article.


Page Options:
format for printing  Format for Printer
email article  Email Page
add to your favorites   Add to Favorites
How would you rate the quality of this content?
Poor - - Excellent
Comments?
Overall Rating:
Comments Left:
Left on 4/10/2008 5:55:13 AM by Anonymous
Comments: nice one - your google add covers the content.
Left on 4/18/2005 12:32:57 PM by Anonymous
Comments: Anybody done this in version 3?  IE 3.0.13
  

 Latest Articles
  

 Latest News
  

 

Spotlight
Syndication

 


 


Digg This
 


DotNetNuke Platinum Benefactor

  
 

 Terms Of Use | Privacy Statement
 Copyright 2008 - Santry Technology Solutions, Box 172, Girard, PA 16417, (814) 774-0970