I figured this out... here's what I used
test.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxtoolkit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Accordion Dynamic Content Update Text</title>
<style>
.accordionHeader
{
border: 1px solid #2F4F4F;
color: white;
background-color: #00688B;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}
.accordionHeaderSelected
{
border: 1px solid #2F4F4F;
color: white;
background-color: #2290AD;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}
.accordionContent
{
background-color: #B4CDCD;
border: 1px dashed #2F4F4F;
border-top: none;
padding: 5px;
padding-top: 10px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<ajaxToolkit:ToolkitScriptManager EnablePartialRendering="true" runat="Server" ID="ToolkitScriptManager1" />
<div>
<ajaxToolkit:Accordion id="MyAccordion" runat="server" HeaderCssClass="accordionHeader" ContentCssClass="accordionContent" HeaderSelectedCssClass="accordionHeaderSelected">
<HeaderTemplate>
Header: <%# Eval("Key") %>
</HeaderTemplate>
<ContentTemplate>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="Panel1" runat="server" Visible="false">
Data: <%# Eval("Value") %><br />
</asp:Panel>
<asp:Label ID="Label1" runat="server"></asp:Label>
<asp:HiddenField ID="HiddenField1" runat="server" OnValueChanged="HiddenField_ValueChanged" />
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajaxToolkit:Accordion>
<hr />
<asp:UpdatePanel ID="UpdateMessages" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="lblMessages" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<hr />
<script language="javascript">
timerID = 0;
function paneOnClick(el) {
var trigger = $get(el);
if ( trigger.value != "loaded" ) {
trigger.value = (new Date()).getTime();
clearTimeout(timerID);
timerID = setTimeout("timeoutTrigger('" + el + "')", 2000);
}
}
function timeoutTrigger(el) {
clearTimeout(timerID);
__doPostBack(el, '');
}
</script>
</div>
</form>
</body>
</html>
test.aspx.cs:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic; // for dictionary
public partial class test : System.Web.UI.Page
{
protected void Page_Load( object sender, EventArgs e )
{
if ( !IsPostBack )
{
this.DataBind();
Dictionary<string, string> values = new Dictionary<string, string>();
values["A"] = "This is the value for A";
values["B"] = "This is the value for B";
values["C"] = "This is the value for C";
values["D"] = "This is the value for D";
MyAccordion.DataSource = values;
MyAccordion.DataBind();
lblMessages.Text = "My Accordion Loaded... " + MyAccordion.Panes.Count;
UpdateMessages.Update();
int ctr = 0;
foreach ( AjaxControlToolkit.AccordionPane ap in MyAccordion.Panes )
{
HiddenField hidden = (HiddenField)ap.ContentContainer.FindControl("HiddenField1");
//ap.ContentContainer.ID = "AccordionContent" + ctr;
Label myLabel = (Label)ap.ContentContainer.FindControl("Label1");
myLabel.Text = DateTime.Now.ToLongTimeString();
lblMessages.Text = "Selected index is " + MyAccordion.SelectedIndex;
UpdateMessages.Update();
if ( MyAccordion.SelectedIndex == ctr )
{
Panel myPanel = (Panel)ap.ContentContainer.FindControl("Panel1");
myPanel.Visible = true;
//lb.Enabled = false;
}
else
{
ap.HeaderContainer.Attributes.Add("onclick", "paneOnClick('" + hidden.ClientID + "');");
}
ctr++;
}
}
}
protected void HiddenField_ValueChanged( object sender, EventArgs e )
{
AjaxControlToolkit.AccordionPane ap = (AjaxControlToolkit.AccordionPane)MyAccordion.Panes[MyAccordion.SelectedIndex];
HiddenField hidden = (HiddenField)ap.ContentContainer.FindControl("HiddenField1");
hidden.Value = "loaded";
Panel myPanel = (Panel)ap.ContentContainer.FindControl("Panel1");
myPanel.Visible = true;
Label myLabel = (Label)ap.ContentContainer.FindControl("Label1");
myLabel.Text = "Updated on " + DateTime.Now.ToLongTimeString();
lblMessages.Text = "changed: " + DateTime.Now.ToLongTimeString();
UpdateMessages.Update();
}
}