I am deciding whether to use the Telerik controls for a project. The problem I've got is fairly straightforward and I've tried to create an ultra simple test code to see if it works and it doesn't.
I have a page with various forms of user input. I want a panel that displays a list of dynamically loaded user controls based on the user input.
For my test page I have simply created 3 user controls: control_a, control_b and control_c
On the main page I have a text input box and a "submit" button. I also have a xmlhttppanel and that simply has a placeholder in it The submit_click event simply reads .text property of the text box and does:
foreach (char c in txt_input.Text) {
if ("abc".Contains(c))
{
s = (UserControl)Page.LoadControl(string.Format("~/test/control_{0}.ascx", c));
s.ID = string.Format("asynccontrol_{0}", i++);
ph_panel.Controls.Add(s);
} }
This works. It dynamically loads a set of user controls based on the user input.
However, in control_a I have a label, a text box and a "save" button. The save_click event simply copies the text box text to the label.text
Without using the rad control xmlhttppanel I was having a problem with a standard .net form that the dynamically loaded user controls weren't persisting. The rad xmlhttppanel appears to solve this (fab). However, the save_click event isn't executing. What have I missed?
Do I need to do anything else to make this app run safely and robustly?
<
telerik:RadXmlHttpPanel
runat
=
"server"
ID
=
"pnlRoom"
OnServiceRequest
=
"pnlRoom_ServiceRequest"
EnableClientScriptEvaluation
=
"true"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
RenderMode
=
"Block"
>
<
asp:Repeater
runat
=
"server"
ID
=
"rptGroups"
OnItemDataBound
=
"rptGroups_ItemDataBound"
ClientIDMode
=
"AutoID"
>
<
ItemTemplate
>
<
fieldset
class
=
"fieldsetBlock1"
>
<
div
class
=
"fieldsetTitle"
>
<%# Eval("GROUP_NAME")%>
</
div
>
<
telerik:RadXmlHttpPanel
runat
=
"server"
ID
=
"pnlGroup"
OnServiceRequest
=
"pnlGroup_ServiceRequest"
RenderMode
=
"Block"
>
<
asp:Repeater
ID
=
"rptItems"
runat
=
"server"
EnableViewState
=
"false"
ClientIDMode
=
"AutoID"
>
<
HeaderTemplate
>
<
table
width
=
"574px"
class
=
"hor-minimalist-b"
>
<
tbody
>
</
HeaderTemplate
>
<
ItemTemplate
>
<
tr
>
<
td
style
=
"padding: 12px 8px;"
>
<
a
href
=
"javascript:;"
onclick='<%# string.Format("openItem(this,{0},0);", Eval("JOB_ITEM_ID")) %>'
class="a-job-item">
<%# Eval("ItemSummary") %></
a
>
</
td
>
</
tr
>
</
ItemTemplate
>
<
FooterTemplate
>
</
tbody
> </
table
>
</
FooterTemplate
>
</
asp:Repeater
>
<
div
class
=
"divAddNewLinkButton"
>
<
a
href
=
"javascript:;"
onclick='<%# string.Format("openItem(this,0,{0});", Eval("JOB_ITEM_GROUP_ID")) %>'>
<
span
>✚</
span
> New Item</
a
></
div
>
</
telerik:RadXmlHttpPanel
>
</
fieldset
>
</
ItemTemplate
>
<
SeparatorTemplate
>
<
br
/>
</
SeparatorTemplate
>
</
asp:Repeater
>
</
telerik:RadXmlHttpPanel
>
<
telerik:RadXmlHttpPanel
ID
=
"radXmlHttpPanel"
runat
=
"server"
OnServiceRequest
=
"radXmlHttpPanel_OnServiceRequest"
RenderMode
=
"Block"
EnableClientScriptEvaluation
=
"true"
LoadingPanelID
=
"loadingPanelSupervisorHome"
>
<
div
id
=
"listEmployeeCoverages"
runat
=
"server"
>
<
div
id
=
"employeeCoveragesSchedule"
>
<
telerik:RadScheduler
ID
=
"schedulerEmployeeCoverage"
runat
=
"server"
SelectedView
=
"TimelineView"
ReadOnly
=
"True"
OverflowBehavior
=
"Expand"
OnNavigationComplete
=
"schedulerEmployeeCoverage_OnNavigationComplete"
OnNavigationCommand
=
"schedulerEmployeeCoverage_OnNavigationCommand"
OnAppointmentDataBound
=
"schedulerEmployeeCoverage_OnAppointmentDataBound"
DataKeyField
=
"Detail.Key"
DataSubjectField
=
"Subject"
DataStartField
=
"Detail.StartDateTime"
DataEndField
=
"Detail.StopDateTime"
>
<
TimelineView
UserSelectable
=
"False"
GroupBy
=
"Employee"
GroupingDirection
=
"Vertical"
ShowInsertArea
=
"False"
SlotDuration
=
"01:00:00"
ShowDateHeaders
=
"true"
ColumnHeaderDateFormat
=
"htt"
></
TimelineView
>
<
DayView
UserSelectable
=
"False"
></
DayView
>
<
WeekView
UserSelectable
=
"False"
></
WeekView
>
<
MonthView
UserSelectable
=
"False"
></
MonthView
>
</
telerik:RadScheduler
>
</
div
>
</
div
>
</
telerik:RadXmlHttpPanel
>