DotNetNuke, AJAX, and DynamicPopulate

Before getting into this, let me qualify this explanation by making it clear I have little idea about the DNN framework, AJAX, postbacks, and client vs. server code.

In trying to build a DotNetNuke module with a DynamicPopulate extender from the AJAX control toolkit, I followed the article at http://www.adefwebserver.com/DotNetNukeHELP/Misc/Dotnetnuke_AJAX_webservices.htm.  To get started and familiarize myself with the control, I built a module that consisted of a button and a label.  The idea was click the button, dynamically populate the label.

First off, I saw the error:

“Web Service Failed: 0″

Google returns results for other error codes, like 400, 500, etc. but not for 0.   The solution is to follow the method at http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryId/1358/DotNetNuke-4-5-Features-Creating-A-DotNetNuke-Module-using-ASP-NET-AJAX-Updated.aspx.  The  key point is:

“The easiest way to deploy ASP.NET AJAX with DotNetNuke is to enable the Supports Partial Rendering flag in the definition for the module control (Host Menu > Module Definitions > Edit Module Definition > Edit Module Control).”

I removed the code added from the first article, enabled Partial Rendering in the Module Definition, and the webservice is called and returns results as expected… but only for a second.  The string from the webservice would show up in the label for half a second, then disappear.

I would seem that enabling partial rendering also allows the module to automatically insert the required references to javascript and webservices required to run the DynamicPopulate control, which is great, but not if the dynamic content gets cleared by the postback.

My only explanation is that the button properly invokes AJAX, but then does a postback, which clears the dynamically populated content.  The only solution I have found for this so far is to wrap the button in an update panel.

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>