Thursday, March 29, 2012

Pass multiple parameters into pages querystring property from jscript

This is a basic question but I cant seem to find the answer anywhere and
have never tried it before.

Here's one of many syntax I'm trying, but should at least show you what I'm
trying to do:

parent.data.frameElement.src="data.aspx?Task=CartAddNew & sku=" + ItemSku;

where there's 2 parameters, Task and sku, and I'm trying to pass a text
value of "CartAddNew" to the Task parameter and a value from the ItemSku
variable to the sku parameter.

Thanks.

--
moondaddy@dotnet.itags.org.nospam.comI found the answer in another posting when I searched on "Pass"

The correct way to separate the 2 parameters and their value assignments is
with a & and no spaces on each side. I had tried it with a space on each
side which made it fail. Here's what worked for me:

parent.data.frameElement.src="data.aspx?Task=CartAddNew&sku=" + sku;

refer to my post below for clarification on the value assignments.

--
moondaddy@.nospam.com
"moondaddy" <moondaddy@.nospam.com> wrote in message
news:%23C96wii$DHA.3960@.TK2MSFTNGP10.phx.gbl...
> This is a basic question but I cant seem to find the answer anywhere and
> have never tried it before.
> Here's one of many syntax I'm trying, but should at least show you what
I'm
> trying to do:
> parent.data.frameElement.src="data.aspx?Task=CartAddNew & sku=" + ItemSku;
> where there's 2 parameters, Task and sku, and I'm trying to pass a text
> value of "CartAddNew" to the Task parameter and a value from the ItemSku
> variable to the sku parameter.
> Thanks.
> --
> moondaddy@.nospam.com

0 comments:

Post a Comment