我正在使用.net 2.0和ajax。我没有弹出来。可能是什么问题。
代码
<act:ToolkitScriptManager ID="Scriptmanager1" runat="server" ></act:ToolkitScriptManager>
<asp:Panel ID="pnlOverlay" style="display:none;" runat="server" CssClass="modalPopup">
Some informative message: Hello world!
</asp:Panel>
<asp:Button ID="MyButton" runat="server" Text="clk" OnClick="MyButton_Click" />
<act:ModalPopupExtender runat="server" ID="mpe"
PopupControlID="pnlOverlay"
BackgroundCssClass="modalBackground"
TargetControlID="MyButton"
BehaviorID="mpeBehaviorID"></act:ModalPopupExtender>
</div>
我在点击按钮时调用mpe.show()。
答案 0 :(得分:0)
这段代码可以帮到你。试试这个......
的CSS
.ModalPopupBG
{
background-color: #666699;
filter: alpha(opacity=50);
opacity: 0.7;
}
.HellowWorldPopup
{
/* min-width: 200px;*/
min-height: 150px;
background: white;
}
这是.aspx代码
<asp:ModalPopupExtender id="ModalPopupExtender1" runat="server"
targetcontrolid="HiddenTargetControlForModalPopup" popupcontrolid="Panel1" drag="true" backgroundcssclass="ModalPopupBG">
</asp:ModalPopupExtender>
<asp:Button runat="server" ID="HiddenTargetControlForModalPopup" style="display:none" />
<asp:Button ID="btnsubmit" runat="server" Text="Add product to list" onclick="btnsubmit_Click"/>
<asp:panel id="Panel1" style="display: block;width:550px;" runat="server">
<div class="HellowWorldPopup">
Some informative message: Hello world!
</div>
</asp:Panel>