Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...How to integrate AJAX code in DotNetNuke?How to integrate AJAX code in DotNetNuke?
Previous
 
Next
New Post
3/25/2009 3:17 PM
 

Hello every body

Please can someone tel me how can I integrate AJAX code in DNN modules?

I tried to do it by myself but the module didn't work and I recieved the following Error message:

Error: Ajax is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: Unable to cast object of type 'ASP.desktopmodules_ajax_ajax_ascx' to type 'DotNetNuke.Entities.Modules.PortalModuleBase'. ---> System.InvalidCastException: Unable to cast object of type 'ASP.desktopmodules_ajax_ajax_ascx' to type 'DotNetNuke.Entities.Modules.PortalModuleBase'. at DotNetNuke.UI.Skins.Skin.InjectModule(Control objPane, ModuleInfo objModule, PortalSettings PortalSettings) --- End of inner exception stack trace ---

I must say that the module works without DotNetNuke(Ajax is just the name of my module)

Please if you have any ideas about this type of situation give me your help because I really need it

Thank you for helping or even for reading!

zied

 
New Post
3/25/2009 3:52 PM
 

To be used as a module in DNN, the control must inherit from DotNetNuke.Entities.Modules.PortalModuleBase.  That appears to be the issue you're running up against here.

Once you get that working, you should call DotNetNuke.Framework.AJAX.RegisterScriptManager to make sure that there is a ScriptManager on the page (don't add your own in the control).

Hope that helps,


Brian Dukes
Engage Software
St. Louis, MO
866-907-4002
DNN partner specializing in custom, enterprise DNN development.
 
New Post
3/25/2009 7:15 PM
 

Brian Dukes wrote

To be used as a module in DNN, the control must inherit from DotNetNuke.Entities.Modules.PortalModuleBase.  That appears to be the issue you're running up against here.

Once you get that working, you should call DotNetNuke.Framework.AJAX.RegisterScriptManager to make sure that there is a ScriptManager on the page (don't add your own in the control).

Hope that helps,

Thank you Brian for your help but I swear that I tried to find the solution since I recieved your answer but no way!!!

I know that you don't have so much time, but I hope if you give me the code behind that I should Write for this very simple code of Ajax.ascx file and I'll be really thankful!!!

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Ajaxl.ascx.vb" Inherits="DesktopModules_Ajax_Ajaxl" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server"> 
        <asp:ScriptManager ID="ScriptManager1" runat="server" />       
        <div>       
            <asp:UpdatePanel ID="UpdatePanel1" runat="server" >
                <ContentTemplate>           
                    Il est : <%=DateTime.Now.ToLongTimeString()%>           
                </ContentTemplate>           
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick"  />
                </Triggers>           
            </asp:UpdatePanel>    
        </div>       
        <asp:Timer ID="Timer1" runat="server" Enableview_state="true" Enabled="true" Interval="1000">
        </asp:Timer>
    </form>
</body>
</html>

Tank you very much

 
New Post
3/26/2009 10:56 AM
 

You can only include Controls as DNN modules, not full .aspx pages.  So, first, you'll need to remove everything from the docytype to the ScriptManager, and also the closing for, body, and html tags at the bottom.

Then, in your code behind, make sure that your class (DesktopModules_Ajax_Ajaxl) Inherits PortalModuleBase.  Add a method that handles the Me.Init event, and call AJAX.RegisterScriptManager() in that method.

Hope that helps,


Brian Dukes
Engage Software
St. Louis, MO
866-907-4002
DNN partner specializing in custom, enterprise DNN development.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...How to integrate AJAX code in DotNetNuke?How to integrate AJAX code in DotNetNuke?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out