Session Variables not being read

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
bdaltilio
Advanced
Advanced
Posts: 15
Joined: Mon Oct 03, 2005 4:37 pm

Session Variables not being read

Post by bdaltilio »

I have a menu that is not reading the session variables. I know the session variables are there because I did a response write on the asp page before and after I call the menu and they do print.

Here is part of the asp menu data I am using, the session variable is Session("Region")

Code: Select all

with(milonic=new menuname("contact")){
style=menuStyleSub;
aI("text=Locate a Sales Manager;url=/contact/locate_sales_manager.asp;status=Locate a Sales Manager");
aI("text=Locate a Distributor;url=/contact/locate_distributor.asp;status=Locate a Distributor");
<%
set adoConn = server.createobject("adodb.connection")
set adoRS = server.createobject("adodb.recordset")
adoConn.Open application("conn_ConnectionString")
sSQL = ""
sSQL = sSQL & "SELECT DISTINCT CT.Name, CT.ctID, ISNULL(CT.dspOrder, '99999') dspOrder FROM Contacts AS C "
sSQL = sSQL & "JOIN ContactType AS CT ON CT.ctID = C.ctID "
sSQL = sSQL & "WHERE C.RegionID = " & Session("Region") & " "
sSQL = sSQL & "OR C.RegionID = 0 "
sSQL = sSQL & "ORDER BY dspOrder, CT.NAME"
set adoRS = adoConn.Execute(sSQL)
IF NOT adoRS.EOF THEN
Do Until adoRS.EOF
%>
aI("text=<%=adoRS("Name")%>;url=/contact/?id=<%=adoRS("ctID")%>&r=<%=Session("Region")%>;status=<%=adoRS("Name")%>;");
<%
adoRS.MoveNext
Loop
END IF
adoRS.Close
adoConn.Close
sSQL = ""
%>
}
Can someone tell me what is going wrong?
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hmmm. Looks OK to me at first glance. Are the other values in the aI() string getting set properly from your record set? Have you tried using the Session.Contents() syntax? (Not that it should make a difference... just throwing out random thoughts.)

Try a js test. Stick an alert in your javascript code, sort of like:

Code: Select all

alert("--" + <%=Session("Region")%> + "--");
Does the session variable show in the alert box?

Kevin
bdaltilio
Advanced
Advanced
Posts: 15
Joined: Mon Oct 03, 2005 4:37 pm

Post by bdaltilio »

It was a rogue javascript elsewher on the page that was messing it up. Thanks for the help.
Post Reply