473,471 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Page Title

How can I get the page title into an variable to handle in my asp.
Don
Jul 19 '05 #1
6 2456
Don Grover wrote on 31 jan 2004 in microsoft.public.inetserver.asp.general:
How can I get the page title into an variable to handle in my asp.


The question is not very clear,
as we do not know what you mean with "my ASP",
but let's assume you mean a serverside variable:

<% pageTitle = "This is page One" %>
<title><%=pageTitle%></title>

If, however, you mean a clientside variable,
please ask in a clientside NG.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2
Thanks for answering Evertjan
I did not want to rabbit on about it But !,.

I am using a whoson.asp page that at the moment displays the script name ie
mypag.asp in the display.
Instead of this I want to use the page title their on.
This is coming from an include file tagged onto every asp page on my site.

What I want to do on server side is grab the page title and stick it in a
vbscript variable to I can pick it up in the include and replace the page
name with the page title.
I dont want to have to do this on 250 pages & development site pages
<% pageTitle = "This is page One" %>
<title><%=pageTitle%></title>

There must be a way to grab the page title server side. ?

Don


"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Don Grover wrote on 31 jan 2004 in

microsoft.public.inetserver.asp.general:
How can I get the page title into an variable to handle in my asp.


The question is not very clear,
as we do not know what you mean with "my ASP",
but let's assume you mean a serverside variable:

<% pageTitle = "This is page One" %>
<title><%=pageTitle%></title>

If, however, you mean a clientside variable,
please ask in a clientside NG.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 19 '05 #3
Don Grover wrote on 31 jan 2004 in
microsoft.public.inetserver.asp.general:
What I want to do on server side is grab the page title and stick it
in a vbscript variable to I can pick it up in the include and replace
the page name with the page title.
I dont want to have to do this on 250 pages & development site pages
<% pageTitle = "This is page One" %>
<title><%=pageTitle%></title>

There must be a way to grab the page title server side. ?


[please do not toppost on usenet]

Sure there is, but setting an include on all your 250 pages can easily
be done with an advanced editor like Editpad in one go.

Otherwise, do you want to insert the title serverside every time a page
is called?

==============

So you want to grab the page title and insert it into the page name?
In my book the page name is the same as the page title. ;-)

Please define.

===============

Changing the page name/title can be done with serverside Regex:

Jscriptlike serverside Pseudocode:

<%
t = getPageAsString("mypage.asp")
t = t.replace(/<title>(.*)?<\/title>/im,"my new title")
ReplacePageWithString("mypage.asp",t)
%>


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #4
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Don Grover wrote on 31 jan 2004 in
microsoft.public.inetserver.asp.general:
What I want to do on server side is grab the page title and stick it
in a vbscript variable to I can pick it up in the include and replace
the page name with the page title.
I dont want to have to do this on 250 pages & development site pages
<% pageTitle = "This is page One" %>
<title><%=pageTitle%></title>

There must be a way to grab the page title server side. ?


[please do not toppost on usenet]

Sure there is, but setting an include on all your 250 pages can easily
be done with an advanced editor like Editpad in one go.

Otherwise, do you want to insert the title serverside every time a page
is called?

==============

So you want to grab the page title and insert it into the page name?
In my book the page name is the same as the page title. ;-)

Please define.

===============

Changing the page name/title can be done with serverside Regex:

Jscriptlike serverside Pseudocode:

<%
t = getPageAsString("mypage.asp")
t = t.replace(/<title>(.*)?<\/title>/im,"my new title")
ReplacePageWithString("mypage.asp",t)
%>

I have editpad, but the Title is hard coded ie. like <title>PURCHASING :
ADD</title>
using editpad i know i can fly through all pages and add a line feed and
new line containing <% myVar = something.title %> after the </title>
but what code can i add to the page to put the title in a vbscript variable
'myVar'
it will then renew it every time page loads, and I can pick up var in
existing footer code.
Thats as clear as Ican make it ?.
Don


Jul 19 '05 #5
Don Grover wrote on 31 jan 2004 in
microsoft.public.inetserver.asp.general:
I have editpad, but the Title is hard coded ie. like
<title>PURCHASING : ADD</title>


Editpad can replace across multiple files with Regex,
so I think you can replace the regex string:

<title>.*?<\/title>

with

<% response.write "<title>" & myTitle & "</title>" %>

or even better with

<!--#include virtual ="/myTitleInserter.inc.asp"-->

in this latest case you can later change the whole title setup
by filling the file "/myTitleInserter.inc.asp" with:
<%
rsv = request.servervariable("SCRIPT_NAME")
if rsv = "/q/bonny.asp" then
myTitle = "Marvellous Title"
else
myTitle = "Normal Title"
end if
response.write "<title>" & myTitle & "</title>"
%>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #6
You could always use client-side javascript to write out the parts of
the page which contain the title (failing gracefully on non js-enabled
browsers of course...)

Tim

"Don Grover" <sp******@assoft.com.au> wrote in message
news:O0**************@TK2MSFTNGP12.phx.gbl...
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Don Grover wrote on 31 jan 2004 in
microsoft.public.inetserver.asp.general:
What I want to do on server side is grab the page title and stick it in a vbscript variable to I can pick it up in the include and replace the page name with the page title.
I dont want to have to do this on 250 pages & development site pages <% pageTitle = "This is page One" %>
<title><%=pageTitle%></title>

There must be a way to grab the page title server side. ?

[please do not toppost on usenet]

Sure there is, but setting an include on all your 250 pages can easily be done with an advanced editor like Editpad in one go.

Otherwise, do you want to insert the title serverside every time a page is called?

==============

So you want to grab the page title and insert it into the page name? In my book the page name is the same as the page title. ;-)

Please define.

===============

Changing the page name/title can be done with serverside Regex:

Jscriptlike serverside Pseudocode:

<%
t = getPageAsString("mypage.asp")
t = t.replace(/<title>(.*)?<\/title>/im,"my new title")
ReplacePageWithString("mypage.asp",t)
%>

I have editpad, but the Title is hard coded ie. like

<title>PURCHASING : ADD</title>
using editpad i know i can fly through all pages and add a line feed and new line containing <% myVar = something.title %> after the </title>
but what code can i add to the page to put the title in a vbscript variable 'myVar'
it will then renew it every time page loads, and I can pick up var in existing footer code.
Thats as clear as Ican make it ?.
Don

Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: the wonderer | last post by:
This is an elementary question, but I've not been able to find the answer, so here goes: I am developing a site using php. I have the html header information in a file that I include in all the...
1
by: alex | last post by:
Hi ! I couldn't make backups with our new system using db2 8.2. Every time I trigger a backup I get this error message: BACKUP DATABASE EBUERO2 ONLINE TO "/raid/backup/ebuero2/part1",...
5
by: Maxim Izbrodin | last post by:
Hello For displaying page titles for my ASP.NET applications I use the following technique <title><%=BannerModule.PageTitle%></title where BannerModule.PageTitle is a public field of my user...
4
by: Glenn M | last post by:
I have a shared XML file on a server . i also have one xslt file that performs a simple transform on in to view the data. now i want to have another page that lets users modify the shared xml...
14
by: Paul | last post by:
I want to set the page title and/or a form hidden field programatically through ASP.Net. I do not want to use something like... <% sTitle ="My Title" %> <html><title><%=sTitle%></title>..... ...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
1
by: vj | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file? I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
0
by: Spondishy | last post by:
Hi, I have a fairly simple httpmodule tied in to the endrequest event of the pipeline that writes the page title to the iis log. The problem is, I have a page where the title is changed in the...
4
osward
by: osward | last post by:
I had made a table colum sortable and paging the table, following are the code // Display Event List echo "<center>"._EVENTLIST."</center><br>"; $now = Date(Y-m-d); // sort table...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.