Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP session variable madness

Status
Not open for further replies.

topcat1a

Programmer
Jan 6, 2005
34
GB
Hello,

I am including one ASP file within another.

<head>
<!-- #include file="inc/finalGlobal.asp"-->

I then call a function within the included file, the result of this is a few session variables are set.

<%breadcrumb()%>

I then try and access a session variable within the meta tag.

<meta name="Tilte" content="<%Response.Write(Session("homeValue"))%>">

However the variables are being displayed in the top left corner of the page and not within the meta tags????

<a href= > <a href = ' holiday.co.uk/prolsearch.asp?search=a'> holiday Search: a</a> > <a href = ' holiday.co.uk/productssearch.asp?search=aa street by street berkshire'> Guide books and Maps for: aa street by street berkshire</a>

<meta name="keywords" content="">

Dose anyone have any idea why this is so?
 
My guess is the two "'s surrounding homevalue. Try replacing with "".

<meta name="Tilte" content="<%Response.Write(Session(""homeValue""))%>">

--------------------------------
Rome did not create a great empire by having meetings, they did it by killing all those who opposed them.
 
i'm not seeing what gpz's seeing.

To me it looks like there is no value set for
Session("homeValue")

Try debugging with a response.write session("homeValue") right after you call the function - if nothing, than dive into the function itself - response.write within it - or put it on a separate page to also debug with a response.write.

You can also set an arbitrary value above the meta tag declaring what the session("homeValue") is just to make sure your calling it correctly like this.

Code:
<% Session("homeValue")="testing value" %>
<meta name="Tilte" content="<%=(Session("homeValue"))%>">

if that spits it out correctly than it is in your function or the calling of the function.

Stuart
 
It would be helpful if we could see your breadcrumb function. It sounds like it is Response.Write'ing the values and (as schase proposed) not setting the session variables. That would explain why the values are being displayed at the top left of the screen and also why they are not showing up in the meta tags. Is it possible you were testing at some point and forgot to switch out the Response.Write's with session var assignments?

 
Hi

My point (not well made) was that the " in front of homevalue is being paired with the " after content= thus ending the setting of metatag content. Although now I really think about it (i.e not after a 3 hour meeting) I'm probably typing cr@p.

--------------------------------
Rome did not create a great empire by having meetings, they did it by killing all those who opposed them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top