Below you can copy and paste the code files from the article, DotNEtNuke w/ AJAX Toolkit.
Listing One - Place in DemoControl.ascx
Current Time:
Listing Two - Place in DemoControl.ascx.vb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
'Register AJAX components if available
If DotNetNuke.Framework.AJAX.IsInstalled Then
'Register the script manager
DotNetNuke.Framework.AJAX.RegisterScriptManager()
'Wrap the pnlAjaxUpdate within an update panel with progress control
DotNetNuke.Framework.AJAX.WrapUpdatePanelControl(Me.pnlAjaxUpdate, True)
'Register the btnPostbackTimeUpdate button as a postback control
DotNetNuke.Framework.AJAX.RegisterPostBackControl(Me.btnPostbackTimeUpdate)
End If
End If
End Sub
Listing Three - Place in DemoControl.ascx.vb
Protected Sub ButtonClick(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles btnAjaxTimeUpdate.Click, btnPostbackTimeUpdate.Click
'Sleep for 5 seconds to simulate a long running process
Threading.Thread.Sleep(5000)
'Update the label
lblCurrentTime.Text = System.DateTime.Now.ToString()
End Sub
Listing 4 - Place in DemoControl.ascx
Add this to the top:
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
Add this below the first panel we added
Collapsible Panel Demonstration
ID="panelExtender"
runat="server"
TargetControlID="pnlCollapse"
CollapsedText="Click to Expand"
ExpandedText="Click to Collapse"
TextLabelID="lblAction"
CollapseControlID="pnlHeader"
ExpandControlID="pnlHeader"/>
The content inside this panel can be expanded or collapsed by using the ASP.NET AJAX Control Toolkit's
CollapsiblePanelExtender.
Additional text can be included as well as ANY other desired HTML or ASP.NET server side controls
This is the last paragraph of example text