我可以在 visual studio 2005 中使用 ajaxToolkit:ModalPopupExtender

can i use ajaxToolkit:ModalPopupExtender in visual studio 2005

我有一个 asp.net Web 表单的项目,它是在 visual studio 2005 年开发的。我正在尝试使用模式弹出窗口(使用 ajaxToolkit:ModalPopupExtender),但它不是 working.But 它在 vs2010 中完美运行。这让我很困惑。 vs2005可以实现吗

是的,这是可能的,您尝试使用此代码 --添加ajaxcontroltoolkit---

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

-- 取fale按钮---

<asp:LinkButton Text="" ID="lnkFake" runat="server" />

--- 然后你拿这个代码---

 <ajaxToolkit:ModalPopupExtender ID="mpe" EnableViewState="true" runat="server" PopupControlID="pnlPopup"
                TargetControlID="lnkFake" CancelControlID="btnClose" BackgroundCssClass="modalBackground">
            </ajaxToolkit:ModalPopupExtender>
            <asp:Panel ID="pnlPopup" runat="server" CssClass="modalPopup" Width="50%" Style="display: none;
                background-color: lightsteelblue;">
                <asp:Label runat="server" ForeColor="Green" ID="lblModelShow" Font-Size="12px" Font-Bold="true"></asp:Label>
                <div style="display: block; overflow: auto; width: 100%; height: 700px; text-align: center"
                    class="textarea">
                    <div class="row">
                        <div id="Div1" style="overflow: scroll; height: 620px;">
                            <br />
                            <br />
                            <asp:GridView ID="GridView1" runat="server" Height="1px" Width="750px" CellPadding="4"
                                BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px">
                                <Columns>
                                    <asp:TemplateField HeaderText="SL">
                                        <ItemTemplate>
                                            <%#Container.DataItemIndex+1 %>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
                                <RowStyle CssClass="AlternatColor" Width="80px" ForeColor="#003399" />
                                <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
                                <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" CssClass="AlternatColor" />
                                <HeaderStyle BackColor="#003399" BorderStyle="Double" Width="80px" Font-Bold="True"
                                    ForeColor="#CCCCFF" />
                            </asp:GridView>
                        </div>

--- 这是 C# 代码--- --- 你可以尝试在哪个事件中展示你的道具 ----

 mpe.Show(); 

你也可以用这个:

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %> 



<asp:LinkButton ID="lnkbutton" runat="server"></asp:LinkButton>
        <ajaxToolkit:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panel1" TargetControlID="lnkbutton"
            CancelControlID="btnClose" BackgroundCssClass="modalBackground">
        </ajaxToolkit:ModalPopupExtender>
        <asp:Panel ID="Panel1" runat="server" CssClass="modalPopup " align="center" Style="display: none">
            <h2 style="color: #000; text-decoration: underline">
                <asp:Label ID="lblGridHeader" runat="server" Text="`enter code here`Points Redeem"></asp:Label></h2>
                <div>

                </div>
            <asp:Button ID="btnClose" runat="server" Text="Close" />
        </asp:Panel>

风格:

<style type="text/css">
        body {
            font-family: Arial;
            font-size: 10pt;
        }

        .modalBackground {
            background-color: #ccc;
            filter: alpha(opacity=90);
            opacity: .9;
        }

        .modalPopup {
            background-color: #fff;
            border: 3px solid #ccc;
            padding: 10px;
            width: 900px !important;

        }

        @-webkit-keyframes blinker {
            from {
                opacity: 1.0;
            }

            to {
                opacity: 0.2;
            }
        }

        .blink {
            text-decoration: blink;
            -webkit-animation-name: blinker;
            -webkit-animation-duration: 0.8s;
            -webkit-animation-iteration-count: infinite;
            -webkit-animation-timing-function: ease-in-out;
            -webkit-animation-direction: alternate;
        }

        .modal {
            position: fixed;
            top: 0;
            left: 0;
            background-color: #0000009e;
            z-index: 500;
            opacity: 1;
            filter: alpha(opacity=80);
            min-height: 100%;
            width: 100%;

        }

        .modal-backdrop {
            position: fixed;
            top: auto;
            right: 0;
            bottom: 0;
            left: 0;
            z-index: 1040;
            background-color: #000;
        }

        .modal-dialog {
            width: 1220px;
        }
    </style>