protected void ShipZip_OnTextChanged(object sender, EventArgs e)
    {
        PopulateZipCityState();
        this.UpdatePanelShippingAddressWrap.Update();

        if (ShipZipCityState.Visible)
        {
            ShipZipCityState.Focus();
        }

        if (ShipOtherCity.Visible)
        {
            ShipOtherCity.Focus();
        }
    }
Exemplo n.º 2
0
    public override void SaveViewToModel()
    {
        Page.Validate("VGShippingAddress");
        if (!IsDynamicZipEntry())
        {
            ZipCodeValidator.CountryID = AspDotNetStorefrontCore.AppLogic.GetCountryID(this.ShipOtherCountry.SelectedValue);

            Page.Validate("VGShippingOtherAddress");
        }

        if (Page.IsValid)
        {
            String city    = GetSelectedCity();
            String state   = GetSelectedState();
            String country = GetSelectedCountry();

            if (city.Length > 0 && state.Length > 0 && country.Length > 0)
            {
                SaveAddress(ShipAddress1.Text, ShipAddress2.Text, city, state, ShipZip.Text, country, !CheckBoxCommercial.Checked);
            }
            else
            {
                PopulateZipCityState();

                this.UpdatePanelShippingAddressWrap.Update();

                if (ShipZipCityState.Visible)
                {
                    ShipZipCityState.Focus();
                }

                if (ShipOtherCity.Visible)
                {
                    ShipOtherCity.Focus();
                }
            }
        }
    }
Exemplo n.º 3
0
    protected void ShipZip_OnTextChanged(object sender, EventArgs e)
    {
        string eventTarget = Request.Params["__EVENTTARGET"];

        // when we programmatically set the password value it causes this event to fire
        // even when a different control triggers the postback.
        // SO, make sure the text box triggers the postback
        if (eventTarget.Contains("ShipZip"))
        {
            PopulateZipCityState();
            this.UpdatePanelShippingAddressWrap.Update();

            if (ShipZipCityState.Visible)
            {
                ShipZipCityState.Focus();
            }

            if (ShipOtherCity.Visible)
            {
                ShipOtherCity.Focus();
            }
        }
    }