reference the document object?

G

Guest

Is it possible to reference a Web page title
(Document.Title) in an asp page? For example,
<% Document.Title%> embedded in the body of an asp page?

This would allow a server side include that changes a
header at the top of the page, based on the page Title.

Thanks, Jim
 
A

Aaron [SQL Server MVP]

No, you can base it on the URL, but ASP doesn't have access to the
client-side HTML. Unless, of course, you opened the ASP file with
FileSystemObject and parsed for <title></title>. But blecch.
 
E

Evertjan.

wrote on 23 jun 2004 in microsoft.public.inetserver.asp.general:
Is it possible to reference a Web page title
(Document.Title) in an asp page? For example,
<% Document.Title%> embedded in the body of an asp page?

There are no asp-pages, a page is a clientside thing.

There are serverside .asp files,
that render clientside html [or other] files,
defaultly keeping the extention name .asp
This would allow a server side include that changes a
header at the top of the page, based on the page Title.

try:

<!-- #include file ="setmyServersideTitleValue.asp"-->
<title><%=myServersideTitleValue%></title>

or even:

<!-- #include file ="setmyServersideTitleValue.asp"-->
<script type="text/javascript">
document.title = '<%=myServersideTitleValue%>'
// mind the lowercase
</script>
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,156
Messages
2,570,878
Members
47,413
Latest member
KeiraLight

Latest Threads

Top