1
    <asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">

        <style type="text/css">
        .ModalPopupBG
{
    background-color: #666699;
    filter: alpha(opacity=50);
    opacity: 0.7;
}

.HellowWorldPopup
{
    min-width:200px;
    min-height:150px;
    background:white;
}
    </style>
<asp:button id="Button1" runat="server" text="Button" />

<ajx:modalpopupextender id="ModalPopupExtender1" runat="server" 
    cancelcontrolid="btnCancel" okcontrolid="btnOkay" 
    targetcontrolid="Button1" popupcontrolid="Panel1" 
    popupdraghandlecontrolid="PopupHeader" drag="true" 
    backgroundcssclass="ModalPopupBG">
</ajx:modalpopupextender>

<asp:panel id="Panel1" style="display: none" runat="server">
    <div class="HellowWorldPopup">
                <div class="PopupHeader" id="PopupHeader">Header</div>
                <div class="PopupBody">
                    <p>This is a simple modal dialog</p>
                </div>
                <div class="Controls">
                    <input id="btnOkay" type="button" value="Done" />
                    <input id="btnCancel" type="button" value="Cancel" />
        </div>
        </div>
</asp:panel>

</asp:Content>

我把上面的代码放在了sharepoint中,我还在母版页中更改了ajaxtoolkit scriptmanager。但是代码仍然不起作用。我在.net平台上试过它工作正常。

4

1 回答 1

0

现在问题已经解决了,我使用的是 Ajaxtoolkit 3.5 和 sharepoint 2010。由于 sharepoint 2010 使用 4.0 .Net 版本和使用 3.5 .Net 版本构建的 Toolkit 存在兼容性问题,所以我参考了 Ajaxtoolkit 3.0 。问题已解决

于 2012-04-20T08:12:12.350 回答