Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the Page Title to save time in Navigation

Status
Not open for further replies.

MahendraMahey

Programmer
May 13, 2003
13
GB
I am a newbie to vbscript and asp but let me try and explain what I want to do.

I want use the Page Title, assign it to a variable and then use it to display a navigation link as active or not.

For example:

If the page title is 'International news'


There are links on the page that say:

Home Regional National International


What I want:

Assign the page title to a variable
If variable="International news' then display 'International'
Else display '<A HREF=&quot;../international/index.asp&quot;>International</A>'


How would I do this? If you could give me an example of real code on how this would work I would be really grateful.


Thanks

Mahendra
 
strTitle = &quot;International News&quot;
.
.
.
If strTitle = &quot;International News&quot; Then
Response.Write(&quot;International News&quot;)
Else
Response.Write(&quot;<A HREF='international/index.asp'>International News</A>&quot;)
End If
 
Thanks for this but how I am able to get the value of the page title into a strTitle. Could I assign document.title to it? If so, could you show me how?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top