kapiljoshi
asked on
AJAX Update Panel control with dropdownlist not doing partial postback
I'm using an AJAX Extension Update panel control. I'm using 2 dropdown list controls.
here, once i select an item from the first drpdown the second dropdown should get populated with the related entries. both the dropdowns are in the update panel control. Please refer to the markup code for the same :
In the event handler for cmd_SelectedIndexChanged I have the following in code behind (refer below) :
But everytime i select an item from the cmd dropdown it does a post back refreshing the whole page. please let me know what am i doing wrong to avoid a post back & just do a partial update.
Thanks,
Kapil.
here, once i select an item from the first drpdown the second dropdown should get populated with the related entries. both the dropdowns are in the update panel control. Please refer to the markup code for the same :
In the event handler for cmd_SelectedIndexChanged I have the following in code behind (refer below) :
But everytime i select an item from the cmd dropdown it does a post back refreshing the whole page. please let me know what am i doing wrong to avoid a post back & just do a partial update.
Thanks,
Kapil.
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel Visible="true" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="cmd" EventName="SelectedIndexChanged"/>
</Triggers>
<ContentTemplate>
<asp:DropDownList ID="cmd" runat="server" AutoPostBack="true"
onselectedindexchanged="cmd_SelectedIndexChanged">
</asp:DropDownList>
<asp:DropDownList ID="cmdOrders" runat="server">
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
protected void cmd_SelectedIndexChanged(object sender, EventArgs e)
{
populateOrders(cmd.SelectedValue);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That's normal behaviour, actually. The entire page is loaded again on the server but only the part required by the updatepanel is updated on the client side.
ASKER
ok. wait i'll check out if i can make out a marked difference using the AJAX control & without one.
ASKER
ok i got it now, i tested it with a Button control .
Thanx.
Thanx.
ASKER
Or how do i know that its not doing a postback.
thanks for trying it out.