I have a page that runs a jquery onclick event. The event loads an an external .aspx file into a div. The page that's being loaded has a drop down list with an autopostback attribute that passes the selected item to a label.
Everything works fine except that the .aspx file that's being loaded will only post back once. After that no more autopostback. Here's my code
----- external.aspx ------
---- default.aspx ------
As stated the div loads just fine, but external.aspx will only update lblPrice once. Then it no longer auto updates. Any help would be greatly appreciated specifics please....
Everything works fine except that the .aspx file that's being loaded will only post back once. After that no more autopostback. Here's my code
----- external.aspx ------
Code:
<script>
protected void ddlPrices_SelectedIndexChanged(object sender, EventArgs e)
{
lblPrice.Text = ddlPrices.SelectedValue.ToString();
}
</script>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlPrices" runat="server" AutoPostBack="true"
onselectedindexchanged="ddlPrices_SelectedIndexChanged">
<asp:ListItem>Basic</asp:ListItem>
<asp:ListItem>Pro</asp:ListItem>
<asp:ListItem>Platinum</asp:ListItem>
<asp:ListItem>Baller!</asp:ListItem>
</asp:DropDownList>
<asp:Label ID="lblPrice" runat="server"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
Code:
<script>
$(document).ready(function () {
$("li#empNav1").click(function () {
$("div.subItem").load('external.aspx');
});
});
</script>
<ul class="nav-left">
<li id="empNav1" class="selected"><a href="#">Employer Overview</a></li>
<li id="empNav2"><a href="#">Why We're Better</a><span></span></li>
</ul>
<div class="subItem"></div>
Comment