简体   繁体   English

将在asp.net中发回邮件始终会导致“导航消失”警告

[英]Will postback in asp.net always causes a “navigate away” warning

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. 到目前为止,我有一个非常简单的问题使我难堪..我正在尝试在ASP.NET中进行一级层叠下拉菜单。

So, I have two drop down boxes (among other text boxes), after ddlOne is selected, then ddlTwo will be populated. 因此,我有两个下拉框(以及其他文本框),选择ddlOne之后,将填充ddlTwo。

here's my code in aspx 这是我在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? 有什么想法吗?

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? 您是用来创建该警告的Javascript吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM