Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 13th, 2007, 04:26 PM
Authorized User
 
Join Date: Feb 2005
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default cannot get title to display correctly

Hi,
The following code does not display the title string at the top of the browser and I can't find the answer in the books - its got to be so simple, but wood for trees etc...
thanks in advance for any help...

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>

<script runat="server">

    sub page_load(obj as object, e as eventargs)
        session("PID") = "xyz"
        server.execute("hc\hc.aspx")
    end sub

</script>

<html>
<head>
<title>TGT Togail na Gaillimhe Teo - </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
 
Old June 13th, 2007, 08:41 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Umm? What are you trying to do in the title string? outside of your code this looks like a static page??

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old June 14th, 2007, 07:30 AM
Authorized User
 
Join Date: Feb 2005
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

DP: As I said, I just want the browser (IE) to display the title string as it appears in the HTML title tag. It doesn't and I wondered why. The rest of the page is irrelevant to the question. If all you can do is point me unhelpful sites, then please don't bother to reply.
R.
 
Old June 14th, 2007, 09:02 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Easy now. Doug is on point here.

You have this in your page: <title>TGT Togail na Gaillimhe Teo - </title>

Are you saying that the text "TGT Togail na Gaillimhe Teo - " is not showing up in the browser title bar? Or are you trying to change it programmatically?

We can only assume that you are asking a programming question in an ASP/ASP.NET category. If your question is about something particular to HTML, please try the appropriate forum category.

Is it possible that whatever code is running when you call the server.execute("hc\hc.aspx") is changing the page behavior? Have you looked at the output HTML in the browser source to see what's in the <title> tag? Please try to be more descriptive with your problem before you snap back at people, or you won't get much help. Vague questions get vague answers.

-Peter
 
Old June 14th, 2007, 03:54 PM
Authorized User
 
Join Date: Feb 2005
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply Peter,
Sorry if I sounded a bit off.
I think I'm right however as sending me to a link entitled :

Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html

does nothing to resolve my query.

I believe it is an ASP question in so far as I do not understand why using a HTML <TITLE> tag with the title string as shown in a VB page results in the browser title displaying:

Untitled Document - Windows Internet Explorer

No, I don't try to change programmatically - though a pointer there would be neat too.

Thanks,
Ru
 
Old June 14th, 2007, 08:05 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Ah... don't mind the links... that's just his message signature.

What is showing up in the browser source HTML? If the text isn't there, then there is definately something causing other HTML to get emitted.

I'm suspicious of the call you have to server.execute("hc\hc.aspx"). While I have never used that in ASP.NET and hardly ever, if at all, in classic ASP... I wonder if that isn't the culprit. If that is resulting in HTML getting emitted to the page, it's likely that there's an empty title tag that the browser is seeing before the one in the page actually called by the browser. So the browser is ignoring the one you want it to see.

What are you using that server.execute for? There is little reason to use that methodology in ASP.NET so I'm curious what it's doing.

-Peter
 
Old June 15th, 2007, 09:45 AM
Authorized User
 
Join Date: Feb 2005
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Peter,

Thanks for explaining about the links and appologies to DP. I misunderstood.

Thanks also for the clue to the problem.. It was as you thought and to answer your question, hc.aspx is a basic hit counter to count sessions and the pages viewed by each session. It had unecessary HTML code, including a <TITLE> tag with the suspect title...

regards,

Ru
 
Old June 19th, 2007, 08:28 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Ah, that's what I suspected.

You could put that type of logic into the global class that has events for each session start and page load so that you don't need to worry about including it into each page of the application.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Emails not formatted correctly. mcarol44 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 9 November 9th, 2007 03:53 AM
ForeColor doesn't display correctly. goldenstate ASP.NET 2.0 Basics 3 February 16th, 2007 12:36 PM
Starting Off Correctly... JESwan XML 0 April 28th, 2005 08:01 AM
No error but not working correctly! Adam H-W Javascript 7 November 10th, 2003 09:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.