Cannot redirect after HTTP headers have been sent.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 лет назад
Scrooby wrote:
...

You're right. Thanks for reporting. Although you still can get "Cannot redirect after HTTP headers have been sent" log messages when using RemotePost class, it works fine (I've just tested) and a customer is redirected to a third-party site. What browser are you using?
12 лет назад
Thanks for your response. I'm browsing in Firefox 10.0.2. I also just tested in Google Chrome and got the same result.

If I replace:

if (this.Response.IsRequestBeingRedirected)
{
    //redirection has been done in PostProcessPayment
    return Content("Redirected");
}
else
{
    //if no redirection has been done (to a third-party payment page)
    //theoretically it's not possible
    return RedirectToRoute("CheckoutCompleted");
}


With just:

return Content("Redirected");


I still get the blank page (still not redirecting to PayPoint), but I don't get an error in my Log table.
12 лет назад
Seems that RemotePost doesn't work on your machine at all. Could you please try another browser and let me know whether it works?
12 лет назад
Just tried on Google Chrome and Internet Explorer 9 and got the same result, a blank page and a "Cannot redirect after HTTP headers have been sent." error in my Log table.
12 лет назад
If I do what Chease did and change Compression to "False", the POST to PayPoint works fine...
10 лет назад
Where do i disable the compression ?
7 лет назад
Also make sure PaymentMethodType is set to Redirection. Mine was different but it worked when I changed it! (:

        /// <summary>
        /// Gets a payment method type
        /// </summary>
        public PaymentMethodType PaymentMethodType
        {
            get
            {
                return PaymentMethodType.Redirection;
            }
        }
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.