Jon, I'm battling to figure out how to do a simple label update. Basically, I want to have my DNNEditLabel update another label. I am declaring everything, but once I get this working I will do it all progamatically - unforunately I can't even get my label to update with a (dirty ;) UpdatePanel.
Here is my markup (simple as possible):
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<DNN:DNNLabelEdit id="editLabel" Text="click on me to edit" CallBackType="ProcessPage" runat="server" CssClass="label" LabelEditCssClass="labeledit" WorkCssClass="labeleditwork" MouseOverCssClass="labelhover" OnUpdateLabel="lblStatus_UpdateLabel" />
<br />
<asp:Label ID="lblIntegration" runat="server" Text="Integration" />
</ContentTemplate>
</asp:UpdatePanel>
lblStatus_UpdateLabel just has
lblIntegration.Text = "Updated " + DateTime.UtcNow.ToString();
and I've debugged it and it is defiintely being called.
Things I have tried:
CallBackType of ProcessPage instead of Simple (as per your template tutorial)
I read somewhere that both controls have to be inside the same UP container, which they are, but I also tried an asyncronous trigger but that did not work.
Am I being really thick or is there more to it than this? Other controls (like a button) next to the DNNEditLabel update the label fine, just not the DNNEditLabel! Once I get this working I can look at your more efficient way.
ps - here is another attempt (using a Trigger):
<DNN:DNNLabelEdit id="editLabel" Text="click on me to edit" CallBackType="ProcessPage" runat="server" CssClass="label" LabelEditCssClass="labeledit" WorkCssClass="labeleditwork" MouseOverCssClass="labelhover" OnUpdateLabel="lblStatus_UpdateLabel" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="lblIntegration" runat="server" Text="Integration" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="editLabel" EventName="UpdateLabel" />
</Triggers>
</asp:UpdatePanel>