Thank you very much, however, does not work.
I tried to recover the value as you told me. But it does not find anything.
This is the code of the function:
/// <summary>
/// Loads selected billing address info.
/// </summary>
protected void LoadBillingAddressInfo()
{
// Try to select company address from ViewState first
if (!ShoppingCartControl.IsCurrentStepPostBack && ShoppingCartControl.GetTempValue(BILLING_ADDRESS_ID) != null)
{
LoadBillingFromViewState();
}
else
{
int addressId = 0;
if (drpBillingAddr.SelectedValue != "0")
{
addressId = Convert.ToInt32(drpBillingAddr.SelectedValue);
AddressInfo ai = AddressInfoProvider.GetAddressInfo(addressId);
if (ai != null)
{
txtBillingName.Text = ai.AddressPersonalName;
txtBillingAddr1.Text = ai.AddressLine1;
txtBillingAddr2.Text = ai.AddressLine2;
txtBillingCity.Text = ai.AddressCity;
txtBillingZip.Text = ai.AddressZip;
txtBillingPhone.Text = ai.AddressPhone;
txtCF.Text = ai.GetStringValue("AddressCF", "");
CountrySelector1.CountryID = ai.AddressCountryID;
CountrySelector1.StateID = ai.AddressStateID;
CountrySelector1.ReloadData(true);
}
}
else
{
// Clean billing part of the form
CleanForm(true, false, false);
// Prefill customer company name or full name
if ((ShoppingCart.Customer != null) &&
(ShoppingCart.Customer.CustomerCompany != ""))
{
txtBillingName.Text = ShoppingCart.Customer.CustomerCompany;
}
else
{
txtBillingName.Text = ShoppingCart.Customer.CustomerFirstName + " " + ShoppingCart.Customer.CustomerLastName;
}
}
}
}