当我尝试在第一个完成之前在 Firefox 的 sharepoint 2013 上的 UpdatePanel 中执行第二个 xmlhttprequest 时,我会刷新整个页面。第一个请求状态为 Aborted。第二个请求响应是:1|#||4|97|pageRedirect||%2f_login%2fdefault.aspx%3fReturnUrl%3d%252fsites%252ftest%252fPages%252fUpdatePanelTest.aspx|
可以使用附加代码重现此错误(快速单击按钮两次会产生错误)。
仅当我将具有此控件的 Web 部件放置在 Sharepoint 2013 上的发布页面上时,才会出现此问题。
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TestUpdatePanel.ascx.cs"
Inherits="Example.TestUpdatePanel" %><asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:CheckBoxList runat="server" ID="CheckboxList1" AutoPostBack="true">
<asp:ListItem Text="CheckBox1" Value="valueFromCheckBox1" />
<asp:ListItem Text="CheckBox2" Value="valueFromCheckBox2" />
<asp:ListItem Text="CheckBox3" Value="valueFromCheckBox3" />
<asp:ListItem Text="CheckBox4" Value="valueFromCheckBox4" />
<asp:ListItem Text="CheckBox5" Value="valueFromCheckBox5" />
</asp:CheckBoxList>
</ContentTemplate></asp:UpdatePanel><asp:UpdatePanel ID="UpdatePanel2" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="CheckboxList1" EventName="SelectedIndexChanged" />
</Triggers>
<ContentTemplate>
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Button" />
<br />
<asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
</ContentTemplate></asp:UpdatePanel>
protected void Page_Load(object sender, EventArgs e)
{
CheckboxList1.SelectedIndexChanged += CheckboxList1_SelectedIndexChanged;
}
private void CheckboxList1_SelectedIndexChanged(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(3000);
Label3.Text = CheckboxList1.SelectedValue;
}
protected void Button1_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(3000);
Label1.Text = "Button1_Click";
}
protected void Button2_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(3000);
Label2.Text = "Button2_Click";
}