|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by R8VI in .NET, C# Programming Language, Programming for ASP.NET
Hi,
I have the code below I am bascially making a call to the DB on selected index changed of the first drop down.
But nothing seems to get populated in the second drop down.
If I change thebut autopost true for first drop down it works fine but the whole page refreshes i dont want that
Please help
R8VI
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
|
aspx page
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
Country
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Always">
<ContentTemplate>
<asp:DropDownList ID="ddl_1" runat="server" OnSelectedIndexChanged="ddl_1_SelectedIndexChanged"
Width="171px">
<asp:ListItem>147</asp:ListItem>
<asp:ListItem>156</asp:ListItem>
<asp:ListItem>146</asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<br />
City
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddl_2" runat="server" Width="167px">
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddl_1" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</div>
c#
protected void ddl_1_SelectedIndexChanged(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
ddl_2.DataSource = BTU.GtByTForMl(int.Parse(ddl_1.SelectedItem.Value));
ddl_2.DataBind();
}
}
|
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20080625