Hi
I have bound a scheduler to the data source using sqldatasource, following instruction from here http://www.telerik.com/help/aspnet-ajax/scheduler-declarative-data-binding.html, except I did not assign any resources. The code is given below at the end.
Problem is when I press the Save in editor I get below error;
Invalid object passed in, member name expected. (46): {"command":"InsertAppointment","appointment":{,"Subject":"776","Description":"","Resources":[],"RecurrenceState":0},"startDate":"201108020000","endDate":"201108030000"}
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Invalid object passed in, member name expected. (46): {"command":"InsertAppointment","appointment":{,"Subject":"776","Description":"","Resources":[],"RecurrenceState":0},"startDate":"201108020000","endDate":"201108030000"}
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: Invalid object passed in, member name expected. (46): {"command":"InsertAppointment","appointment":{,"Subject":"776","Description":"","Resources":[],"RecurrenceState":0},"startDate":"201108020000","endDate":"201108030000"}]
System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeDictionary(Int32 depth) +854
System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) +161
System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeDictionary(Int32 depth) +464
System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) +161
System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer) +81
System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit) +37
System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(String input) +75
Telerik.Web.UI.SchedulerPostBackEvent.DeserializeFromJSON(String json, RadScheduler scheduler) +148
Telerik.Web.UI.RadScheduler.RaisePostBackEvent(String eventArgument) +52
Telerik.Web.UI.RadScheduler.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4645
What am I missing?
Many Thanks
Regards
Code Follows:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Availability.ascx.cs" Inherits="SitefinityWebApp.Widgets.Availability.Availability" %>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
ConflictDetection
=
"CompareAllValues"
ConnectionString="<%$ ConnectionStrings:SitefinityWebApp.Properties.Settings.HSConnection %>"
DeleteCommand="DELETE FROM [Appointments] WHERE [ID] = @original_ID AND [Subject] = @original_Subject AND (([Description] = @original_Description) OR ([Description] IS NULL AND @original_Description IS NULL)) AND [Start] = @original_Start AND [End] = @original_End AND (([RecurrenceRule] = @original_RecurrenceRule) OR ([RecurrenceRule] IS NULL AND @original_RecurrenceRule IS NULL)) AND (([RecurrenceParentID] = @original_RecurrenceParentID) OR ([RecurrenceParentID] IS NULL AND @original_RecurrenceParentID IS NULL)) AND (([Reminder] = @original_Reminder) OR ([Reminder] IS NULL AND @original_Reminder IS NULL)) AND (([Annotations] = @original_Annotations) OR ([Annotations] IS NULL AND @original_Annotations IS NULL))"
InsertCommand="INSERT INTO [Appointments] ([Subject], [Description], [Start], [End], [RecurrenceRule], [RecurrenceParentID], [Reminder], [Annotations]) VALUES (@Subject, @Description, @Start, @End, @RecurrenceRule, @RecurrenceParentID, @Reminder, @Annotations)"
OldValuesParameterFormatString="original_{0}"
SelectCommand="SELECT * FROM [Appointments]"
UpdateCommand="UPDATE [Appointments] SET [Subject] = @Subject, [Description] = @Description, [Start] = @Start, [End] = @End, [RecurrenceRule] = @RecurrenceRule, [RecurrenceParentID] = @RecurrenceParentID, [Reminder] = @Reminder, [Annotations] = @Annotations WHERE [ID] = @original_ID AND [Subject] = @original_Subject AND (([Description] = @original_Description) OR ([Description] IS NULL AND @original_Description IS NULL)) AND [Start] = @original_Start AND [End] = @original_End AND (([RecurrenceRule] = @original_RecurrenceRule) OR ([RecurrenceRule] IS NULL AND @original_RecurrenceRule IS NULL)) AND (([RecurrenceParentID] = @original_RecurrenceParentID) OR ([RecurrenceParentID] IS NULL AND @original_RecurrenceParentID IS NULL)) AND (([Reminder] = @original_Reminder) OR ([Reminder] IS NULL AND @original_Reminder IS NULL)) AND (([Annotations] = @original_Annotations) OR ([Annotations] IS NULL AND @original_Annotations IS NULL))">
<
DeleteParameters
>
<
asp:Parameter
Name
=
"original_ID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"original_Subject"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"original_Description"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"original_Start"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"original_End"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"original_RecurrenceRule"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"original_RecurrenceParentID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"original_Reminder"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"original_Annotations"
Type
=
"String"
/>
</
DeleteParameters
>
<
InsertParameters
>
<
asp:Parameter
Name
=
"Subject"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"Description"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"Start"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"End"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"RecurrenceRule"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"RecurrenceParentID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"Reminder"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"Annotations"
Type
=
"String"
/>
</
InsertParameters
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"Subject"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"Description"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"Start"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"End"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"RecurrenceRule"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"RecurrenceParentID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"Reminder"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"Annotations"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"original_ID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"original_Subject"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"original_Description"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"original_Start"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"original_End"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"original_RecurrenceRule"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"original_RecurrenceParentID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"original_Reminder"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"original_Annotations"
Type
=
"String"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
<
telerik:RadScheduler
ID
=
"RadScheduler1"
runat
=
"server"
DataEndField
=
"End"
DataKeyField
=
"ID"
DataSourceID
=
"SqlDataSource1"
DataStartField
=
"Start"
DataSubjectField
=
"Subject"
SelectedView
=
"MonthView"
Skin
=
"Windows7"
>
</
telerik:RadScheduler
>