I'm trying to get a modal popup box to work inside of a DNN module that I'm working on. I am using the modal popup from the AJAX toolkit. I am able to get this to work in a stand alone page built inside of Visual Studio (that is not in a module), but when I implement this same functionality in a module, it does not work... the screen just flickers.
From what I've read about AJAX functionality in DNN (on Michael Washington's web site) it seems that I need to register the script manager in the code-behind and that will inject the AJAX functionality at load time. Please correct me if I'm wrong. I've been able to get an update panel to use AJAX functionality and update the time, but am having issues with the modal popup.
This is my code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="DemoControl.ascx.cs" Inherits="DesktopModules_DemoApp_DemoControl" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ccl" %>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
<asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton>
<asp:Panel ID="popUpPanel" runat="server" CssClass="modalPopup">
<br />
<p>This is content inside the panel....wehrojakadjfkads
fajdkjfakldsjf kadjfad aadfakd ak fjdk fadl fakd s</p>
<p>This is content inside the panel....wehrojakadjfkads
fajdkjfakldsjf kadjfad aadfakd ak fjdk fadl fakd s</p>
<p>This is content inside the panel....wehrojakadjfkads
fajdkjfakldsjf kadjfad aadfakd ak fjdk fadl fakd s</p>
<p>
<asp:LinkButton ID="OkButton" runat="server">Ok</asp:LinkButton>
<asp:LinkButton ID="CancelButton" runat="server">Cancel</asp:LinkButton>
</p>
</asp:Panel>
<ccl:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
BackgroundCssClass="modalBackground" CancelControlID="CancelButton"
OkControlID="OkButton" PopupControlID="popUpPanel"
TargetControlID="LinkButton1">
</ccl:ModalPopupExtender>
Then in the code behind my code is:
public partial class DesktopModules_DemoApp_DemoControl : DotNetNuke.Entities.Modules.PortalModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (DotNetNuke.Framework.AJAX.IsInstalled())
{
DotNetNuke.Framework.AJAX.RegisterScriptManager();
}
}
}
I am missing something or am doing something incorrectly. If you have any experience using the modal pop-up extender inside of the AJAX toolkit from Visual Studio, I would be greatly appreciative of any insight or guidance you can provide.
Thanks for your time
Clint