database - Asp.Net RadioButtonList Selected ListItem Not Recognized on Page Revisit -


There are two radio button list list items (the codes shown below) on my shipping address page, which is correct or false on the database by user. Writes input

The first time a user selects the value and transfers to the next step of the checkout process, their address type is stored correctly (true / false) in the database. If they go back to the shipping address page, then select the opposite ListItem and go to the next checkout page, their updated shipping type has not changed in the database. It looks like if the listing does not recognize the user's radiobutton selection while reviewing the page.

Can someone please help understand this one?

shipping address.cakes

  & amp; Asp: RadioButtonList ID = "ShipoAddressType" runat = "server" & gt; & Lt; Asp: ListItem Value = "0" id = "businessShipping" & gt; My shipping address is a business. & Lt; / Asp: ListItem & gt; & Lt; Asp: ListItem value = "1" id = "residency" & gt; My shipping address is a residence. & Lt; / Asp: ListItem & gt; & Lt; / ASP: RadioButtonList & gt;   

shipping addresscax.com

  if (Resident Asping. Selected == true) shipping order. Monstrous = true; More shippingAdmission. Monstrous = false;   

Shipping addresses .ascx.cs Page_load

  Secure Zero Page_load (Object Sender, EventEurge E) {User User = Tokens} Instance.User; Address shipAdmission = Null; Foreach (Address time temporary address in user.) If (tempAddress.Nickname == "shipping") shipAddress = tempAddress; // Radio users of the return users, select the already selected ship type if (ShipEdress! = Faucet) {if (ShipEdress.Residence == Incorrect) {ShipToAddressType.SelectedIndex = 0; } And {ShipToedressType Selected index = 1; }}}}    

to code you Page_Load For Page_init . Otherwise viewstate will not work and you will not make changes to the events. PreLoad before Init .

After the state is loaded. You should also wrap your init code in a IsPostBack check. Although I can wrong what you are doing here

  Secure Zero Page_in (EventArgs e) {if (IsPostBack) {User User = Tokens.Instance. the user; Address shipAdmission = Null; Foreign currency (Address in the address to the fresh academy address in the user) {if (tempAddress.Nickname! = "Shipping") {continue; } ShipToAddressType Selected index = 1; }} ShipoAddressType Selected index changed + = shippoadderTypeScendedIndex changed; } Zero ShipToAddressTypeSelectedIndexChanged (Object Sender, EventArgs E) {// Save State State of Response.Redirect (Request.RawUrl) to refresh the database to new state / redirect; }    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -