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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create .asp URL w/onClick event and Session Variable

Status
Not open for further replies.

UncleCake

Technical User
Feb 4, 2002
355
US
Hi, I am trying to make a hyperlink with a form button using a cart number that I store in a session variable. I get the page to come up, but I cannot get the session variable part of the url. It go goes to the page, but the url stops after the =.

Here is the code.

Response.Write("<INPUT TYPE='button' onClick=parent.location='saveCart.asp?ID=' + session(BasketId") value='Save My Cart' class='btn' onmouseover=""hov(this,'btn btnhov')"" onmouseout=""hov(this,'btn')""")
 
Response.Write("<INPUT TYPE='button' onClick=parent.location='saveCart.asp?ID=' + session(BasketId") value='Save My Cart' class='btn' onmouseover=""hov(this,'btn btnhov')"" onmouseout=""hov(this,'btn')""")

This is an ASP question (forum333)

Code:
Response.Write("<INPUT TYPE='button' onClick=""parent.location='saveCart.asp?ID=" & session(BasketId") & "&value='Save My Cart'"" class='btn' onmouseover=""hov(this,'btn btnhov')"" onmouseout=""hov(this,'btn')""")

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook

zen.gif

 
mwolfe00,

I posted to this forum because I thought that the onClick was Javascript. Thanks for the reply, but the after the appostrphy that is located before

'Save My Cart

it is commenting out the rest of the line. I tried putting in the qutotation mark in the session(BasketId"), that didn't help. The issue isn't the session, it's get the onClick URL to be created. I have played around with ' and " in many different spots and I just can't get the url built.

I can repost my question in the ASP fourm.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top