asp.netvisual-studio-2005modalpopupextender

can i use ajaxToolkit:ModalPopupExtender in visual studio 2005


I have a project in asp.net web form which is developed in visual studio 2005. I am trying to use modal popup(using ajaxToolkit:ModalPopupExtender) but it's not working.But it's perfectly works in vs2010. This make me confused. Is it possible to make it happen in vs2005.


Solution

  • Yes it's possible, you try to flow this code --add ajaxcontroltoolkit---

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

    -- take fale button---

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

    --- then you take this code---

     <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>
    

    --- this is c# code--- --- which event wise you can try to show your propup ----

     mpe.Show();