Click to See Complete Forum and Search --> : Calling Javascript from ASP and using ASP variables


JAllbon
10-21-2003, 10:24 AM
Hi -I'm very new to all ASP and Javascript, so forgive me if I've put this question in the wrong forum.

I have a bit of ASP code that does a response.write offering a link. The location of the link is determined by a value from a database. I am appending the link with the database's Primary Key in the form
<a href='TestPage.asp?ID=" & IndexID & "> &PageName & "</a>"
There are other variables passed from this link as well.

All very well and good, but I have some JavaScript that opens the window in another window withouth scrollbars etc. This is called through an onClick("../PathToPage.asp"); However, when I try using ASP to write Javascript, strange things happen. The variables seem to be passed across in the querystring, but as one entire string, rather than individual variables and their individual components/values are not accessible.

Any ideas as to where I go from here would be much appreciated.
Thanks in advance.
Jon.

rdoekes
10-21-2003, 02:12 PM
are you sure the variables are in the following format:

<a href="<% = "pathtoasp.asp?ID=" & indexID & "&var1=" & strVar1 & "&var2=" & strVar2%>">

Response.Write "<a href=""pathtoasp?ID=" & indexID & "&var1=" & strVar1 & "&var2=" & strVar "">"
Hope this helps,

-Rogier Doekes

JAllbon
10-21-2003, 04:03 PM
It's not so much the embedding of the variables in the ASP string, but using JavaScript to call the ASP variables. I understand that there's an order in which Java and ASP execute and that ASP is server based, so you'd presumably need to pass the variables from ASP to Java.
The problem I'm getting is referencing ASP variables with Java and making the two work together.

Thanks
Jon