I have a RadWindow with a content template containing 3 labels. The window is displayed on Button click, but the labels do not update in the RadWindow, instead they keep thier default value. Any help would be great!
Code is a as follows: -
ASPX Page
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
EnableShadow
=
"True"
KeepInScreenBounds
=
"True"
Behaviors
=
"Close, Reload"
Modal
=
"True"
ReloadOnShow
=
"True"
VisibleStatusbar
=
"False"
>
<
Windows
>
<
telerik:RadWindow
ID
=
"winRegisterSum"
runat
=
"server"
>
<
ContentTemplate
>
<
br
/>
<
asp:Label
ID
=
"Label2"
runat
=
"server"
Text
=
"Submit register with the following:"
></
asp:Label
>
<
br
/><
br
/>
<
asp:Label
ID
=
"lblPresents"
runat
=
"server"
Text
=
"Presents"
></
asp:Label
>
<
br
/>
<
asp:Label
ID
=
"lblAbsents"
runat
=
"server"
Text
=
"Presents"
></
asp:Label
>
<
br
/>
<
asp:Label
ID
=
"lblLates"
runat
=
"server"
Text
=
"Presents"
></
asp:Label
>
<
br
/><
br
/>
<
asp:Button
ID
=
"btnConfirm"
runat
=
"server"
Text
=
"Confirm"
CssClass
=
"defaultButton"
OnClick
=
"btnConfirm_Click"
/>
</
ContentTemplate
>
</
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
Code Behind
Label lblPresents = winRegisterSum.ContentContainer.FindControl("lblPresents") as Label;
Label lblAbsents = winRegisterSum.ContentContainer.FindControl("lblAbsents") as Label;
Label lblLates = winRegisterSum.ContentContainer.FindControl("lblLates") as Label;
lblPresents.Text = "New Label";
lblAbsents.Text = "New Label";
lblLates.Text = "New Label"
string script = "function f(){$find(\"" + winRegisterSum.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);