In the website I'm currently building we need a large number of dynamic redirects, in order to maintain flow through parts of the site.
I'm currently using response.redirect to achieve this, with the redirection URL being dynamically generated in the code behind on the postback method of various buttons.
This is fine in 95% of the cases, however I am noticing that sometimes the URL is mangled horribly.
In one case, the url is URLEncoded, as one of the parameters sometimes contains an ampersand, however the redirect is ignoring this and redirecting to a non-encoded version.
i.e. "page.aspx?qs=first%26second&qs=2&qs=3" is being redirected to "page.aspx?qs=first&second&qs=2&qs=3"
the other case that happens is that the response is completely stripped of ampersands, leading to frequent crashes.
i.e. "page.aspx?qs=1&qs=2&qs=3" is being redirected to "page.aspx?qs=1qs=2qs=3"
Does anyone have any ideas why either of these scenarios might happen?
RESOLVED
Sorry, this was due to my own idiocy, in redirecting from admin to non-admin (don't ask), and not putting the &s back in or url encoding again on a couple of pages.
(facepalm)