Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6535585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:23:26+00:00 2026-05-25T10:23:26+00:00

On my shipping address page there are two RadioButtonList ListItems (code shown below) that

  • 0

On my shipping address page there are two RadioButtonList ListItems (code shown below) that write to a database true or false based on user input.

The first time a user selects a value and moves to the next step of the checkout process their ship to address type is stored correctly (true / false) in a database. If they go back to the shipping address page, select the opposite ListItem and move on to the next checkout page, their updated shipping type is not changed in the database. It is as if the ListItem does not recognize the user’s radiobutton selection has changed when revisiting the page.

Can someone please help figure this one out?

ShippingAddress.ascx

<asp:RadioButtonList id="ShipToAddressType" runat="server">
    <asp:ListItem Value="0" id="businessShipping">My shipping address is a business.</asp:ListItem>
    <asp:ListItem Value="1" id="residenceShipping">My shipping address is a residence.</asp:ListItem>
</asp:RadioButtonList>

ShippingAddress.ascx.cs

if (residenceShipping.Selected == true)
    shippingAddress.Residence = true;
else
    shippingAddress.Residence = false;

ShippingAddress.ascx.cs Page_Load

protected void Page_Load(object sender, EventArgs e)
{
    User user = Token.Instance.User;

    Address shipAddress = null;

    foreach (Address tempAddress in user.Addresses) if (tempAddress.Nickname == "Shipping") shipAddress = tempAddress;

    // sets radio button of return users previously selected ship type
    if (shipAddress != null)
    {
        if (shipAddress.Residence == false)
        {
            ShipToAddressType.SelectedIndex = 0;
        }
        else
        {
            ShipToAddressType.SelectedIndex = 1;
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:23:27+00:00Added an answer on May 25, 2026 at 10:23 am

    You need to move the code in Page_Load to Page_Init. Otherwise ViewState won’t work and you won’t get change events. View state is loaded after Init before PreLoad.

    You should also wrap your init code in a IsPostBack check. Although I may misunderstand what you are doing here.

    protected void Page_Init(EventArgs e)
    {
        if (!IsPostBack)
        {
            User user = Token.Instance.User;
    
            Address shipAddress = null;
    
            foreach (Address tempAddress in user.Addresses)
            {
                if (tempAddress.Nickname != "Shipping")
                {
                    continue;
                }
                ShipToAddressType.SelectedIndex = 1;
            }
        }
        ShipToAddressType.SelectedIndexChanged += ShipToAddressType_SelectedIndexChanged;
    }
    
    void ShipToAddressType_SelectedIndexChanged(object sender, EventArgs e)
    {
        // save the new state to database
    
        // redirect to enforce refresh of saved state
        Response.Redirect(Request.RawUrl);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two instances of an Address.ascx control in an ASP.NET MVC page. <h1>Shipping
I have a shipping form. Three input fields surround the shipping address. Below are
I need to call a variable that is a customer’s shipping address attribute, in
I'm working on the address page for a shopping cart. There are 2 <select>
With Google Checkout, is there any way to pass in a default shipping address
There's already some shipping modules such as FEDEX, Flat Rate, Per pieced and UPS
I'm creating a log shipping configuration between two sql server 2005 instances. I'm shipping
How can I set the shipping cost for Magento for all baskets that are
I like to know if I can copy the shipping address to billing address.
I have a form that has a Is you billing address the same as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.