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.
|
|
|
|
|