private void LoadControlData(bool forceReload = false) { var paymentOptions = PaymentOptionInfoProvider.GetPaymentOptions(ShoppingCart.ShoppingCartSiteID, true) .Column("PaymentOptionID") .OrderBy("PaymentOptionDisplayName"); if (ShoppingCart.ShippingOption == null || !ShoppingCart.IsShippingNeeded) { paymentOptions.WhereTrue("PaymentOptionAllowIfNoShipping"); } var paymentIds = paymentOptions.GetListResult <int>(); // If there is only one payment method set it if (paymentIds.Count == 1) { var paymentOptionID = paymentIds.First(); ShoppingService.SetPaymentOption(paymentOptionID); drpPayment.SelectedID = paymentOptionID; // Make sure that in-memory changes persist (unsaved address, etc.) Service.Resolve <ICurrentShoppingCartService>().SetCurrentShoppingCart(ShoppingCart); } drpPayment.DisplayOnlyAllowedIfNoShipping = (ShoppingCart.ShoppingCartShippingOptionID <= 0) || !ShoppingCart.IsShippingNeeded; if (!RequestHelper.IsPostBack() || forceReload || ((ShoppingCart.ShoppingCartPaymentOptionID != 0) && !PaymentOptionInfoProvider.IsPaymentOptionApplicable(ShoppingCart, ShoppingCart.PaymentOption))) { // Reset selector on shipping changed event if selected payment is not allowed for current shipping (zero shipping id is Please select state). drpPayment.Reload(); drpPayment.SelectedID = ShoppingService.GetPaymentOption(); } }