Results 1 to 5 of 5

Thread: Document Title

  1. #1

    Thread Starter
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125

    Document Title

    I'm just barely learning ASP, so bear with me if this is a really simple problem.

    Is there a way to get the title of the page into a variable so that I can write it to the page wherever I want?
    <removed by admin>

  2. #2
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099
    Code:
    <% 
    dim pagetitle
    pagetitle = "ASP Page 1"
    %>
    <html>
    <head>
    <title><%=pagetitle%></title>
    </head>
    <body>
    <%
    response.write "Your page is called " & pagetitle
    %>
    </body>
    </html>
    do u mean something like that?

  3. #3

    Thread Starter
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    Yes, something like that, but I don't want to declare what the title of the page is in a variable first. Isn't there a function or something that will return the title? Like Document.Title or something like that? I know that document.title doesn't work (i've tried) but shouldn't there be something like that?
    <removed by admin>

  4. #4
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    I am not certain, but you could try Javascript. I am sorry but I am not an expert on JS, so you will have to ask somebody else.
    BTW, I think "Document.Title" or a slight variation should work in JS, just confirm it.

  5. #5
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    ASP doesn't really have any special knowledge of the HTML or anything else you use it to generate, so no.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width