Modal Extender Ajax Control Toolkit (ASP 2.0) will not pop-up on server side trigger

273 views Asked by At

I tried to create a modal using ajax control toolkit in my sharepoint services services 3.0 project but the pop up will not show when called in server-side.

//Register Toolkit

<%@ Register Namespace="AjaxControlToolkit" TagPrefix="maku"
Assembly="AjaxControlToolkit, Version=1.0.20229.20821, 
Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" %>

Ascx (Where the extender resides)

<maku:ToolkitScriptManager ID="ScriptManager1" runat="server" />
    <asp:Button ID="btnShow" runat="server" Text="Show Modal Popup"
        OnClick="btnPopup_Click"/>
    <maku:modalpopupextender id="mp1" runat="server" popupcontrolid="PopupCommentPanel" 
        cancelcontrolid="btnClose" backgroundcssclass="modalBackground"
        targetcontrolid="btnShow">
    </maku:modalpopupextender>
    <asp:Panel ID="PopupCommentPanel" runat="server" CssClass="modalPopup" align="center" 
        Height="223px" Width="684px" style="display:none">
        SWIMMING SWIMMING SWIMMING
    </asp:Panel>

Already set mp1 (target control) to css style display:none (where many issues were caused by this). I dont know why the popup will not show.

Here's the server side code :

//Declaration
protected ModalPopupExtender mp1 = null;

// Page Load
protected override void OnLoad(EventArgs e)
{
  // Some code here
   mp1.Show(); // Popup will not show
}

//Also added onclick event for target control id 

protected void btnPopup_Click(object sender, EventArgs e)
{
    this.mp1.Show(); // Popup will also not showing
}

Also added the required dll file in assembly folder :

AjaxControlToolkit.dll(1.0.20229.20821)
System.Web.Extensions.dll(1.0.61025.0)

In my web.config, I already added the ff:

//Safe Controls

<SafeControl Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, 
  PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TypeName="*" Safe="True" />
<SafeControl Assembly="AjaxControlToolkit, Version=1.0.20229.20821, Culture=neutral, 
  PublicKeyToken=28f01b0e84b6d53e" 
  Namespace="AjaxControlToolkit" TypeName="*" Safe="True" />

//Assembly Section

<add assembly="AjaxControlToolkit, Version=1.0.20229.20821, Culture=neutral, 
       PublicKeyToken=28f01b0e84b6d53e"/>
        <add assembly="System.Web.Extensions, Version=1.0.61025.0, 
     Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

//Controls

<add tagPrefix="maku" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit, 
 Version=1.0.20229.20821, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>

I didn't encountered any errors bdway.

0

There are 0 answers