Forum Themes:
Welcome !

 Page Title '<title> </title>' modification

Author Message
Samuel

  • Total Posts : 11786
  • Reward points : 168350
  • Joined: May 23 '01
  • Status: offline
Page Title '<title> </title>' modification Thu. Aug 7, '08 9:24 AM (permalink)
The software sets the page title programatically to your Site Name value you set in the admin control panel. However, on the Forum (tt.aspx) and Message (tm.aspx) page, the title is set to the title of the forum or message, respectively.

For these 2 pages, you can modify the page title in the Page_Prerender handler in the code behind files (tt.aspx.vb and tm.aspx.vb):

 Page.Title += "whatever you want to add" 


The reason for the += is that you might want to preserve the forum / message title we set already for you in Page_Load.

Here is how everything works:

All ASPX pages perform certain pre-defined functions (like include in the ASP era) in page_Init (before page_load), and setting the (page title = site title) is one of the functions in the include.

tt.aspx and tm.aspx extract the message/forum data in page_load (later than page_init), and then sets the page title in page_load, overriding the value set in the page_init in the include.

So, for you to customize the page title, the safest event to change thevalue in is the Page_Prerender event (this happens after page_load and any postback handlers).

If you do not see this event handler already defined for the page, you can add them in. The event handler signature is this:

Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender

End Sub

<message edited by Samuel on Fri. Aug 8, '08 6:28 PM>
ASPPlayground.NET
~ see our Version 4 plans here

 
#1
    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9