D
Don Grover
How can I get the page title into an variable to handle in my asp.
Don
Don
How can I get the page title into an variable to handle in my asp.
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. ?
I have editpad, but the Title is hard coded ie. like <title>PURCHASING :Evertjan. said: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>
Don Grover said:I have editpad, but the Title is hard coded ie. likeEvertjan. said: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)
%>
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.