DotnetNuke AJAX module refreshing the whole page

Posted on 2009-04-21
Last Modified: 2013-11-07

I am new to dotnetnuke and module creation.  I have created a sample AJAX enabled module which shows the time on a button click.

The problem i am facing here is it refreshes the whole page instead of refreshing the update panel.

I am running dotnetnuke 4.9 with visual studio 2005,  ajax 1.0  and ajax control toolkit ver 1.0.20229.0.

Please find the my aspx and code behind page and let me know what am i doing wrong here.

Imports DotNetNuke

Imports System.Web.UI

Imports System.Collections.Generic

Imports System.Reflection

Imports DotNetNuke.Security.PortalSecurity

Partial Class DesktopModules_Test_Test

    Inherits DotNetNuke.Entities.Modules.PortalModuleBase

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If DotNetNuke.Framework.AJAX.IsInstalled Then


        End If

    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

        Label1.Text = Date.Now

    End Sub

End Class


<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Test.ascx.vb" Inherits="DesktopModules_Test_Test" %>

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

<br />

&nbsp;<br />

<asp:UpdatePanel ID="UpdatePanel1" runat="server">


    <asp:Label ID="Label1" runat="server"></asp:Label>

        <br />

        <br />

    <asp:Button ID="Button1" runat="server" Text="Button" />




Open in new window

Question by:Shiva_Kumar
    LVL 2

    Expert Comment

    try setting the updatemode to conditional -

    <asp:UpdatePanel ID="UpdatePanel1" runat="server"

    and then add the button attribute autopostback -
    <asp:Button ID="Button1" runat="server" Text="Button" autopostback="true" />

    Your code should theoretically work though, but these attributes can help in forcing it to. Also make sure the ajax scriptmanager is being registered properly on the pageload (check the page output source) and also in DotNetNuke, there is an setting to add 'partial postbacks' / ajax to a page. When your creating a control to add your new page, go through the settings of it and you should find a checkbox for it.

    Let me know what version you are running of DNN - i will try write down instructions for enabling the ajax mode via the control settings.

    also try:


    Author Comment

    Thanks Clinton for the suggestion...

    I will try thist out tomorrow and will get back to you :)


    Author Comment

    Hi Clinton,

    I have tried your suggestion but it didn't work and its still refreshing the page without showing the time and i am also getting this error message:

    "Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request."

    Please look at the code test.ascx.vb where i am registering the script manager.

    The setting which you were talking about to have the ajax functionality added is the "Partial rendering" which is also enabled to the module.  Let me know if there is some other settings which needs to chaged.

    I am using the dotnetnuke version 4.9



    Author Comment

    Any update?
    LVL 2

    Assisted Solution

    Not sure about the error,

    try returning to your original solution, and then trying this,

    re: Scriptmanager, that should register the script fine - if the "If DotNetNuke.Framework.AJAX.IsInstalled" evaluates to true - have your debugged and stepped through to make sure it's true?

    Also, check your page output - because AJAX is enabled in DNN the framework might already be injecting a script manager for ajax iteself, you can have two script managers on a single page - this could be throwing things off.

    So, 1) Make sure "DotNetNuke.Framework.AJAX.IsInstalled" evaluates to true. Then you know its install.
    2) disable the Register script line (13)  DotNetNuke.Framework.AJAX.RegisterScriptManager()
    totally. and see if it works without dynamically registering it.

    LVL 8

    Expert Comment

    You have to set the properties:
    Supports Partial Rendering?   = True

    you can do this going in ModuleDefinions panel, edit the module settings, in the section listing Controls (bottom of the page) choose to edit option for your view control (tipically the first) and check the option Supports Partial Rendering? , save and retry



    Author Comment

    Hi paololabe,

    Please see my comments above... i have allready enabled the Partial rendering.


    Author Comment

    Hi Clinton,

    Here's the analysis:

    1. "DotNetNuke.Framework.AJAX.IsInstalled" is evaluating to true
    2. removed the line "DotNetNuke.Framework.AJAX.RegisterScriptManager()",  But the problem still persists.  Dunnow what and where i am going wrong here.

    Any other suggestions?


    Accepted Solution


    The problem is fixed.

    I was able to fix the problem by disabling the Caching for the module.
    By setting the default cache time to -1 i was able to fix the problem.


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
    Introduction HyperText Transfer Protocol ( or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video discusses moving either the default database or any database to a new volume.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now