c# - Problem Setting an HtmlSelect after pageload -


I have a C # custom control that I am using to display an address form. In control, I have a choice to choose your state. On my pageload I chose to set a defaults to my public method, where I pass a variable to provide all address information.

My problem is that when I run my own way, selection is not updated for the right selection, any thoughts?

The code below is:

  using the system; Using System.Collections.Generic; Using System.Linq; Using System.Web; Using System.Web.UI; Using System.Web.UI.WebControls; // Epicoter Soap Stuff.Application using Client. Client; Client LE.Application. Common; Using the customer.Modiles.Party. Mango; Using the customer.module.party.Interface; Using System.configuration; Using System.Net; Using System.Data; Nameslot Account Center User Control Address {Public Partial Category AddressFieldSet: System.Web.UI.UserControl {// Credentials Static String EpicorWSLogin = ConfigurationManager.AppSettings ["EpicorWSLogin"]. ToString (); Static String Epicure DESPRESSION = Configuration Manager. App Settings ["apcorderpassword"]. Toasting (); Static String EpicorWSDomain = ConfigurationManager.AppSettings ["EpicorWSDomain"]. ToString (); Network credentials My credentials = new network credentials (EpicroWSOlogin, apocryarddespainword, apocair WSdomain); Private epic organization Organization. Full Dataset Protected Zero Page_load (Object Sender, EventArgues E) {// Load Address Data Epicor_Volume Entry. Value List Entry Value LitinantryWS = New Epicor_Valueentry Value list entry (); ValueListEntryWS.Credentials = myCredentials; Region.DataSource = ValueListEntryWS.GetByListID (ValueListName.PhysicalAddressRegion) .ValueListEntry.Select ("", "Description ASC"); Area. DataTextField = "description"; Area. DataValueField = "Entry"; Region.DataBind (); Country.DataSource = ValueListEntryWS.GetByListID (ValueListName.PhysicalAddressCountry) .ValueListEntry; Country.DataTextField = "Entry"; Country. DataValueField = "ValueListEntryID"; Country.DataBind (); // State / country dropdown set some knowledgeable mistakes for the country. Valu = Clientele.Modules.Party.Interface.Country.USA.ToString (); Area. Value = "md"; } Public Zero Set (epicor_Organization.OrganizationFullDataSet.PhysicalAddressRow address) {_Address = Address; Address1.Value = Address ["Address 1"]. ToString (); Address2.Value = Address ["Address 2"]. ToString (); Address3.Value = Address ["Address 3"]. ToString (); city. Value = address ["city"]. Toasting (); Zip.Value = Address ["Postal code"]. ToString (); Region.Value = Address ["Region_"]. ToString (); Country.Value = Address ["Country ID"]. ToString (); } Public EpicorporterConfirmationAdministrativeDataset Receive physical address () {_ address [[address1]] = address 1. value; _ Address ["address2"] = address2. value; _ Address ["address3"] = address3 value; _ Address ["city"] = city. value; _Edress ["Postal code"] = ZIP. value; _ Address ["area"] = field value; _ Address ["country id"] = country value; Return address; }}}  

With parent controls, I call the set () function in my page_load event. In addition to my selection all the data is set correctly.

Is my problem that I can not set the value of a selection after page_load event? How can I see it?

I have detected that page_load event is firing after my set method. Swap and everything is all good.


Comments