我正在尝试在 AJAX 模式弹出窗口中使用 ajaxToolkit:TabContainer。问题是我在 Internet Explorer 8 中遇到了一个 javascript 错误。它在 Internet Explorer 9 和 Firefox 中确实有效!
htmlfile: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.
如果我默认显示模式弹出窗口,或者如果我删除了 ajaxToolkit:TabContainer 中的所有 ajaxToolkit:TabPanel 元素,我不会收到错误消息。
TabContainer 上是否有以某种方式不设置焦点的选项?
这是一个可用于重现 test.aspx 问题的示例
<asp:UpdatePanel ID="upSystem" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<h2>Test</h2>
<asp:Button ID="cmdPopup" runat="server" CssClass="button btn" Text="Neuen Eintrag erfassen" OnClick="CmdPopupOpen" />
<asp:Panel ID="panList" runat="server" CssClass="modalPopup" Width="500px">
<asp:UpdatePanel ID="upDetail" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:UpdatePanel ID="upData" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<br />
<div class="modal">
<div id="divHeader" runat="server" class="modal-header"><h2 class="messageboxh2">Task Messages</h2></div>
<div class="modal-body">
<asp:Label ID="Label1" runat="server" Text="Task Typ: " />
<asp:DropDownList ID="ddlTaskType" runat="server">
</asp:DropDownList>
<br /><br />
<ajaxToolkit:TabContainer ID="tConNew" runat="server" Height="150px"
>
<ajaxToolkit:TabPanel runat="server" ID="tPanInstant" HeaderText="Sofort" >
<ContentTemplate>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
<div class="modal-footer">
<br/>
<asp:Button ID="cmdClose" runat="server" CssClass="btn" Text="Abbrechen" />
<asp:Button ID="cmdSave" runat="server" CssClass="btn" Text="Speichern" onclick="MpeSave" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<ajaxToolkit:ModalPopupExtender ID="mdlPopup" runat="server"
TargetControlID="lblDummyUpload"
PopupControlId="panList"
BackgroundCssClass="modalBackground"
PopupDragHandleControlID="divHeader"
RepositionMode="None"
CancelControlID="cmdClose"
/>
<asp:Button id="lblDummyUpload" runat="server" style="display:none" />
</ContentTemplate>
</asp:UpdatePanel>
和 test.aspx.cs
public partial class test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void MpeSave(object sender, EventArgs e)
{
mdlPopup.Hide();
}
protected void CmdPopupOpen(object sender, EventArgs e)
{
mdlPopup.Show();
}
}