Skip to main content
Inspiring
May 21, 2007
Question

OnClick and session var

  • May 21, 2007
  • 2 replies
  • 283 views
I have a link and I want to pass a session var to the next page. I
have done it a lot of ways without success. Here is the on I thought
should have worked.

<a href="clst_ed.asp" onClick="javascript: <%"Session("cbsg_a")=
Response.write(rs_clst.Fields.Item("PgID").Value) %>">Edit / Update</a>

Any suggestions?

--

This topic has been closed for replies.

2 replies

Inspiring
May 21, 2007
But wouldn't this show in location bar? I want to pas the var without
anyone seeing it. I do that just fine for security logins and the
like, but doing it from a link has me at a loss.

Julian Roberts wrote:

> What you'd do have your link like
>
> <a href="clst_ed.asp?id=<%=rs_clst.Fields.Item("PgID").Value%>"
>
> and then set the session variable on the clst_ed.asp page
>
> Session("foo")=Request("id")



--

Günter_Schenk
Inspiring
May 21, 2007
>>
I do that just fine for security logins and the like, but doing it from a link has me at a loss
>>

I´m not sure, but doesn´t ASP support encryption & decryption for e.g. variables like PHP ?
Inspiring
May 21, 2007
What you'd do have your link like

<a href="clst_ed.asp?id=<%=rs_clst.Fields.Item("PgID").Value%>"

and then set the session variable on the clst_ed.asp page

Session("foo")=Request("id")

--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004