window.open pass queryString variables

please help. trying to pass variables to new window I am opening using a routine I am calling from onClick="myWin(<%=RsStuff("jobId")%>)"

sub myWin(myVar)
Set Win1 = window.open ("myNewWindow.asp" , "", "resizable=yes, scrollbars=yes, width=300, height=200, top=100, left=400")
end sub

I want to pass the variable as part of queryString eg. "myNewWindow.asp?var1=<%=myVar%>"

I can't seem to work this. The variable is passed to the myWin but not to the new page. I have tried using a Session variable and have the same problem.

any ideas would be most appreciated.
Thanks

Paul


Comments

  • : please help. trying to pass variables to new window I am opening using a routine I am calling from onClick="myWin(<%=RsStuff("jobId")%>)"
    :
    : sub myWin(myVar)
    : Set Win1 = window.open ("myNewWindow.asp" , "", "resizable=yes, scrollbars=yes, width=300, height=200, top=100, left=400")
    : end sub
    :
    : I want to pass the variable as part of queryString eg. "myNewWindow.asp?var1=<%=myVar%>"
    :
    : I can't seem to work this. The variable is passed to the myWin but not to the new page. I have tried using a Session variable and have the same problem.
    :
    : any ideas would be most appreciated.
    : Thanks
    :
    : Paul
    :
    :

    Goto http://www.vbcity.com/forums/topic.asp?tid=1054 for more information...
    Neo Gigs
    http://communities.msn.com.my/VisualBasicwithNeo


  • : please help. trying to pass variables to new window I am opening using a routine I am calling from onClick="myWin(<%=RsStuff("jobId")%>)"
    :
    : sub myWin(myVar)
    : Set Win1 = window.open ("myNewWindow.asp" , "", "resizable=yes, scrollbars=yes, width=300, height=200, top=100, left=400")
    : end sub
    :
    : I want to pass the variable as part of queryString eg. "myNewWindow.asp?var1=<%=myVar%>"
    :
    : I can't seem to work this. The variable is passed to the myWin but not to the new page. I have tried using a Session variable and have the same problem.
    :
    : any ideas would be most appreciated.
    : Thanks
    :
    : Paul
    ----------------------------------------------------------------

    You're having here a problem coz you are mixing Javascript client side scripting and ASP server side.
    sub myWin(myVar) should output Javascript code as :

    : sub myWin(myVar)
    Response.write("")
    : Response.write("<Set Win1 = window.open
    Response.write("<('myNewWindow.asp?var1=' & _ myvar, "", "resizable=yes, scrollbars=yes, width=300, _ height=200, top=100, left=400")
    : end sub

    The clue is to form a string with 'myNewWindow.asp?var1=' + myvar

    Hope that helped
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories