Reputation: 978
I have a pretty simple questions that had stumped me so far .. I am trying to do a one-level cascading drop down in ASP.NET.
So, I have two drop down boxes (among other text boxes), after ddlOne is selected, then ddlTwo will be populated.
here's my code in aspx
<asp:UpdatePanel ID="comboBoxWorkFlowPanel" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlPendingUserGroup" runat="server"
DataTextField="groupName" DataValueField="groupId" OnSelectedIndexChanged="ddlPendingUserGroup_SelectedIndexChanged" AutoPostBack="true">
</asp:DropDownList>
<asp:DropDownList ID="ddlUserGroupUsers" runat="server" Enabled="false"DataTextField="userName" DataValueField="userID"></asp:DropDownList>
</ContentTemplate>
<asp:UpdatePanel>
and pretty much in the code behind page, the event handler will read from the drop down and then populate the second drop down.
my question is, after the selection is made in the first drop down, why am i getting a warning message ("you're about to navigate away from this page")
If i click ok on the warning message, the dropdown box will be loaded correctly, and other values that were previously on the page will be preserved. If i click cancel, i get a script error instead.
any thoughts on this?
Upvotes: 0
Views: 522
Reputation: 2028
Actually, that seems quite odd. There must be something more than what you've put here going on... more code please? Is it Javascript that you're using to create that warning?
Upvotes: 1