Link to home
Start Free TrialLog in
Avatar of vbnetcoder
vbnetcoder

asked on

query string javascript

My page APS gets passed a query string and the request it like this

Request.QueryString("Product_ID")

Now, in the following javascript procedure how would i pass this this query string to the PopupForm.aspx form that is being opened?

  function OpenChild() {

        var WinSettings = "center:yes;resizable:no;dialogHeight:300px"
        // ALTER BELOW LINE - supply correct URL for Child Form
        var MyArgs = window.showModalDialog("../PopupForm.aspx", MyArgs, WinSettings);

    }
Avatar of leakim971
leakim971
Flag of Guadeloupe image

try :

function OpenChild() {

        var WinSettings = "center:yes;resizable:no;dialogHeight:300px"
        // ALTER BELOW LINE - supply correct URL for Child Form
        var pid = "1234";
        var MyArgs = window.showModalDialog("../PopupForm.aspx?Product_ID=" + pid, MyArgs, WinSettings);

    }

Open in new window

Avatar of vbnetcoder
vbnetcoder

ASKER

OK the passing to the new form works find but how do i get the value of product_ID that was passed to the form?
ASKER CERTIFIED SOLUTION
Avatar of Paul Jackson
Paul Jackson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Request.Querystring("Product_ID") can then be used on the child form to get the product id
Where do i put this line of code that you gave me above:

<% Response.write("<script language='javascript'>var prodid = " & Request.QueryString("Product_ID") & ";</script>")%>



Put it in your aspx page just above your javascript functions.
ty