Hey all,
I am having one of the weirdest problems ever....
I have n custom aspx page that gets called from ms cr 4.0 button. When the page loads it poulates a dropdown box with all the coutrys then when i select a country it must load all the provinces for that country. It loads the country data when the form loads but when i select a country and the for does a postback to load the selected countrys provines it loses all the country data??? WHY ??
HTML :
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table style="border: none; width: 500px">
<table style="border: none; width: 300px">
<tr>
<td class="style5">
Country<br />
</td>
<td class="style8">
<asp:DropDownList ID="cboLocationCountry" runat="server" AutoPostBack="True" OnSelectedIndexChanged="cboLocationCountry_SelectedIndexChanged"
TabIndex="5" Width="196px">
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="style5">
Province<br />
</td>
<td class="style8">
<asp:DropDownList ID="cboLocationProvince" runat="server" AutoPostBack="True" Width="196px"
OnSelectedIndexChanged="cboLocationProvince_SelectedIndexChanged" TabIndex="6">
</asp:DropDownList>
</td>
</ContentTemplate>
</asp:UpdatePanel>
Page Load :
if (!IsPostBack)
{
cboLocationCountry.Items.Clear();
loadCRMLookups("country", cboLocationCountry, "");
}
And loading the province data when a country is selected:
protected void cboLocationProvince_SelectedIndexChanged(object sender, EventArgs e)
{
cboLocationTown.Items.Clear();
cboLocationSuburb.Items.Clear();
cboLocationZone.Items.Clear();
loadCRMLookups("town", cboLocationTown, cboLocationProvince.SelectedValue);
loadCRMLookups("zone", cboLocationZone, cboLocationProvince.SelectedValue);
loadCRMLookups("suburb", cboLocationSuburb, cboLocationTown.SelectedValue);
}