Link to home
Start Free TrialLog in
Avatar of Andrew
AndrewFlag for United States of America

asked on

Response.Write with querystring?

Can someone please help me figure out why I can get this to work:

Response.Write("<script>window.open('CCNew.asp','_top');</script>")

but not this:

Response.Write("<script>window.open('CCNew.asp?proxyfor=' & Request.querystring('proxyfor') & '&mode=' & Request.QueryString('mode')','_top');</script>")

TIA,
Andrew
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Window.Open is interpreting this:
'CCNew.asp?proxyfor='


try Repsonse.Write
(String.Format("<script>window.open('CCnew.asp?proxyfor={0}&mode={1}_top</script>", Request.querystring("proxyfor"),  Request.QueryString("mode")))



the {0} . . . {1} . . . {n} get replaced with the extra parameters after the string in order.
Avatar of Andrew

ASKER

hmmm...

Response.Write(String.Format("<script>window.open('CCnew.asp?proxyfor={0}&mode={1}_top</script>", Request.querystring("proxyfor"),  Request.QueryString("mode")))

Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: 'String'
SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America 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
ASKER CERTIFIED SOLUTION
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
Avatar of Andrew

ASKER

Thank you both!