次のコードが動作しています。
public JsonResult AddTicketToCart(...)
{
...
Session.Add("Cart", cart);
return Json(new { IsSuccess = true }, JsonRequestBehavior.AllowGet);
}
JS コードでは:
$.get('/desk/AddTicketToCart', { clientId: clientId, sessionId: sessionId, levelId: levelId, places: places, isWithoutPlace: isWithoutPlace, delivery: delivery }, function (data) {
if (data.IsSuccess) {
if (isQuickBuy)
window.location = '/desk/paywizard';
else
window.location = $('#wiz_header .first-child>a').attr('href');
} else {
toastr.options.timeOut = 10000;
toastr.error('Error.');
}
});
このPayWizard
アクションには次が含まれます。
if (Session["Cart"] == null)
return new HttpNotFoundResult();
var model = CreateViewData<PersonalInfoViewData>();
return View("PersonalInformation", model);
Ipadで404エラーが発生するという問題。デスクトップではすべて正常に動作します。ロギング メッセージを次の場所に追加しますAddTicketToCart
。
public JsonResult AddTicketToCart(...)
{
...
Session.Add("Cart", cart);
if(Session["Cart"] != null)
Logging.Log.Info("Cart not null");
else
Logging.Log.Info("Cart equal null");
var test = (CartModel) Session["Cart"];
if( test != null)
{
Logging.Log.Info("CartModel not null");
Logging.Log.Info("Tickets count: {0}", test.Tickets.Count);
}
else
Logging.Log.Info("CartModel equal null");
return Json(new { IsSuccess = true }, JsonRequestBehavior.AllowGet);
}
出力は次のとおりです。
2012-11-02 09:37:34.4887 | Info | Cart not null
2012-11-02 09:37:34.4887 | Info | CartModel not null
2012-11-02 09:37:34.4887 | Info | Tickets count: 1
ご覧のとおり、Cart
イン セッションが存在します。ButinPaywizard
はヌルに等しいです。どこに問題がありますか?