0

我正在尝试 ModalPopupExtender 的示例。当弹出窗口发生时,弹出窗口后面的控件不会被禁用,也就是说我仍然可以点击弹出窗口后面的按钮。下面是代码

<body>
    <form id="form1" runat="server">
    <div>    
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>
    </div>
    <div>
        <asp:Button ID="Button1" runat="server" Text="Button" />
    </div>
    <div>
        <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" DropShadow="true" TargetControlID="Button1"
         PopupControlID="Panel1" BackgroundCssClass="backgroundModalPopup" PopupDragHandleControlID="Panel1">
        </asp:ModalPopupExtender>
        <asp:Panel ID="Panel1" runat="server" BackColor="Aqua" Style="display:none">
        This is modal pop up extender : hi
         <asp:Button ID="Button2" runat="server" Text="Button" />         
        </asp:Panel>
    </div>
    </form>
</body>

谁能告诉我为什么我无法禁用页面的其余部分?谢谢。

4

1 回答 1

0

最后,我得到了解决方案。问题是 css 没有在 aspx 页面中引用(尽管我添加了代码来链接我的 css 文件)。但奇怪的是,当我通过将 css 文件拖放到 Visual Studio 中的 aspx 页面上来将 css 添加到 aspx 页面时,它起作用了,而当我通过代码引用它时,它对我不起作用。真的很奇怪!!!

谢谢。

于 2013-10-27T05:36:59.657 回答