Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URL not working. Can't remember escape for double ampersand

Status
Not open for further replies.
are you sure that passthrough.aspx is correctly parsing the AD parameter as a URL?

If you want to escape the ampersands then you could use &
but that may not be your problem. It should work fine as is.

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
I would think its having a hard time distinguising the parameters meant for passthrough.aspx from those that belong to the URL paramater in AD.






----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
I can see ItemId in particular being pulled as 56 before I can as 13555 because the 56 is a direct variable on the querysting as opposed to a querystring within a variable in the querystring (AD)???? eh???

[monkey][snake] <.
 
Code:
[URL unfurl="true"]http://www.website.com/Modules/Advertisingmodule/Passthrough.aspx?[/URL][blue]ItemId=56[/blue]&[red]AD=[URL unfurl="true"]http://www.website.com/Default.aspx?PageIndex=2002[/URL][/red]&[green]ItemId=13555[/green]

The first parameter: ItemId is sent to Passthrough.aspx, however starting from the second parameter "AD", which has a URL as a value, is where the problem begins.

I'm guessing the OP wants the ItemID=13555 to get sent to default.aspx instead of passthrough.apsx effectively overwriting the original ItemID, however the parameter is being taken not as part of the AD parameter url but as part of the original URL for passthrough.

So you get in passthrough.aspx an ItemID of 13555 instead of 56.

In other words how to get the last ItemId to get sent to default.aspx instead of passthrough.


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
The only way I can see how to do that is to bound the value of AD with some character and strip that character off after it is pulled,

Code:
[URL unfurl="true"]http://www.website.com/Modules/Advertisingmodule/Passthrough.aspx?[/URL]
[COLOR=blue]ItemId=56&[/color][COLOR=green]AD=[!]|[/!][URL unfurl="true"]http://www.website.com/Default.aspx?PageIndex=2002&ItemId=13555[/URL][!]|[/!][/color]

I'm not 100% sure that would work though, cause I've really never played around with pulling URLs that have a querystring within a querystring.

[monkey][snake] <.
 
Anything you put after the last ItemID paramter gets taken as part of the value.

You have to pass the AD query string through a urlencode function for it to work.

In PHP I would do urlencode($variablecontainingADvalue);

I'm sure there is something similar the OP can use in ASP.

But of course this now falls outside the scope of this Forum.

So I will point the OP to the ASP forum here: forum333 for ASP
and forum855 for ASP.NET





----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
You would need to replace & with %26 to correctly not have it understood as another variable being passed but rather part of a variable. But vacunita is right that you should be looking for something akin to urlencode().
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top