Click to See Complete Forum and Search --> : Using asp type id referral within a Javascript includes page


stevenbali
05-23-2003, 10:26 PM
HI
This query is about the correct syntax for using asp within a menu .js JavaScript page which is then included in a series of asp pages.

The specific function is addmenu()

My drop down menu is by Milonic. I have no problems with it when referring to standard asp pages, but when I want to carry over a session id variable I get an error - Expected ']'.

This is the relevant part of the code:

addmenu(menu=["membership",

,,115,1,"",style1,,"left",effect,,,,,,,,,,,,

,"New Members","show-menu=newmem",,,1

,"Charter Members","memCharter.asp?id=<%=Session("memid")%>",,,1

,"Current Members","show-menu=currentmem",,,1

,"Fellowship","show-menu=fellowship",,,1

])



Can you help me with the correct syntax, please?

Jona
05-23-2003, 10:52 PM
'memCharter.asp?id=<%=Session("memid")%>'

stevenbali
05-24-2003, 05:33 AM
Thanks Jona but it doesn't do the trick.

I have tried the following variations so far with no success:

"memCharter.asp?id=" & <%=Session("memid")%>
error: syntax error

"memCharter.asp?id=" & memid
error: memid is undefined


no syntax error but doesn't pick up the actual id:
"memCharter.asp?id=memid"
"memCharter.asp?id=<%=Session("memid")%>"
'memCharter.asp?id=<%=Session("memid")%>'
"memCharter.asp?id=<%=Session(\"memid\")%>"

Any other thoughts??

khalidali63
05-24-2003, 08:46 AM
Amongst all of your tries,these values
should work

'memCharter.asp?id=<%=Session("memid")%>'
"memCharter.asp?id=<%=Session(\"memid\")%>"

provided that memid is a value stored in the Session object.There may be one more thing to be care of,Session will work only if the cookies are enables of you have cookies disables then session will not work(unles using asp.net where session stores values in url)