<scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit" Subject='<%# Bind("Subject") %>' Description='<%# Bind("Description") %>' Start='<%# Bind("Start") %>' End='<%# Bind("End") %>' RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' Reminder='<%# Bind("Reminder") %>' AppointmentColor='<%# Bind("AppointmentColor") %>' UserID='<%# Bind("User") %>' RoomID='<%# Bind("Room") %>' />Private Sub BindSchedule() Dim ds As List(Of objCRM.Schedule) = objCRM.Schedule.SelectScheduleByUser(Session("User_id")) Scheduler.DataSource = ds Scheduler.DataBind()End Sub<rad:RadScheduler runat="server" ID="Scheduler" Width="753px" Height="600px" EnableExactTimeRendering="true" StartEditingInAdvancedForm="true" StartInsertingInAdvancedForm="true" DataKeyField="Schedule_id" DataStartField="Start" DataEndField="End" DataSubjectField="Subject" DataDescriptionField="Description" DataRecurrenceField="RecurrenceRule" DataReminderField="Reminder" DataRecurrenceParentKeyField="RecurrenceParentSchedule_id" AppointmentContextMenuSettings-EnableDefault="false" TimeSlotContextMenuSettings-EnableDefault="false" TimelineView-UserSelectable="false" > <AdvancedForm Modal="true" /> <Reminders Enabled="True" /></rad:RadScheduler>I have a user control that uses a custom control which has business logic to added controls dynamically. Example text boxes along with lable will be added based on the rule to capture addtional information from user.
If the user control is part of page and displayed using RadWindow then the I do not have any issues and on each post back between client and server dynamically added controls are getting displayed.
When the same user control is displayed inline using "User Control Edit Form" then for the first time dynamically added controls are getting displayed, but on the further post back they are not getting displayed.
In the custom control i am using CreateChildControls() to add controls dynamically.
What I've done is built a "SmartPart" application in SharePoint 2007 which I'm trying to convert to SharePoint 2010. If you're not familiar with SmartPart, it's essentially a wrapper webpart that lets you load .ascx controls from a designated folder on the SharePoint server.
I've used Telerik controls within a series of .ascx controls. In 2007 everything works fine. In SharePoint 2010 I'm experiencing a ScriptHandler.axd "object expected" error whenever I trigger a partial postback to change the mode on a DetailsView control from ReadOnly to Edit or Insert. Changing from Edit/Insert back to ReadOnly, or loading the page with the DetailsView already in Edit/Insert mode does not cause the error.
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Timestamp: Tue, 15 Feb 2011 18:25:21 UTC
Message: Object expected
Line: 5
Char: 32749
Code: 0
URI: http://myHost/ScriptResource.axd?d=5IJVuvjGYmphMWCAkLfCmwAPXrthSXiUWcsZ2-XJPFVyLeGXjv_VkQVwhs7Rbfagz910Hn9YGXyPmImRLglJdlDX3fR00mQLdqSAApxlnZ4LBCFPJ4ROQskZ8-rvBIOcVRyr6yuAXk__TG9yo6erRI62vE01&t=5c2f384e
The DetailsView control is using DynamicFields which are constructed from DynamicData FieldTemplates. In these field templates I'm using Telerik controls such as RadTextBox, RadTooltip, RadDateTimePicker, etc. Those controls are what cause the error after a partial postback. As I said, if I load the page in edit/insert mode to begin with, everything is fine. However if I load the page in ReadOnly mode, then trigger a partial postback which causes the DynamicFields to switch from ASP Labels into Telerik Controls the error happens. I want to reiterate that this worked fine in MOSS 2007.
I also found that the ScriptResource it's referring to is MicrosoftAJAX.js, but I'm not sure what it's expecting at Char 32749. Any ideas?
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"/> <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"> <telerik:RadGrid ID="grdTrainingInstitutes" runat="server" AllowSorting="true" AllowPaging="true" AutoGenerateColumns="false" PageSize="20" RegisterWithScriptManager="true" OnNeedDataSource="grdResults_NeedDataSource" TabIndex="301"> <MasterTableView> <Columns> <telerik:GridBoundColumn DataField="train_inst_id" UniqueName="TrainingInstituteID" HeaderText="ID" HeaderStyle-Width="25" ItemStyle-Wrap="false" HeaderStyle-Wrap="false" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top" ></telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="train_inst_nam" HeaderText="Name" DataField="train_inst_nam" HeaderStyle-Wrap="false" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top" HeaderStyle-Width="100px" ItemStyle-Wrap="false"></telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="address_line" HeaderText="Address" DataField="address_line" HeaderStyle-Wrap="false" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top" HeaderStyle-Width="150px" ItemStyle-Wrap="false"></telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="geographic_area" HeaderText="Geographic Location" DataField="geographic_area" HeaderStyle-Wrap="false" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top" HeaderStyle-Width="60px" ItemStyle-Wrap="false"></telerik:GridBoundColumn> </Columns> </MasterTableView> <ClientSettings AllowKeyboardNavigation="true" AllowDragToGroup="False" AllowColumnsReorder="False"> <Selecting AllowRowSelect="true" UseClientSelectColumnOnly="true" /> <KeyboardNavigationSettings AllowSubmitOnEnter="false" AllowActiveRowCycle="true" EnableKeyboardShortcuts="false" FocusKey="Y" /> <ClientEvents OnRowClick="RowSelected" OnRowDblClick="GridDblClick" OnKeyPress="GridKeyPress" OnGridCreated="GridCreated" /> <Resizing AllowColumnResize="True" /> </ClientSettings> <PagerStyle Mode="NextPrevAndNumeric" /> </telerik:RadGrid> </telerik:RadAjaxPanel>