我有一页处理支付网关响应,PaymentReturn.aspx。在此页面中,我正在记录响应并将响应存储到会话变量中,并将此会话变量用于处理发票页面的另一个页面 Invoice.aspx ... 所以在 PaymentReturn 页面中,我有
Session["ResponseOfPayment"] = paymentResonse as PaymentResponse; // PaymentResonse is class
Response.Write("REDIRECT=http://mydomain.com/Invoice.aspx");
在 Invoice.aspx 我有,
PaymentResponse paymentResonse = Session["ResponseOfPayment"] as PaymentResponse;
if(paymentResponse!=null)
{
// Generate Invoice
}
但我得到的 paymentResonse 实例为空。这是怎么回事?