This is a migrated thread and some comments may be shown as answers.

.NET Exception during Deserialization on Postback with RadDatePicker

4 Answers 109 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Laku
Top achievements
Rank 1
Laku asked on 04 Sep 2009, 06:19 PM
Hello,

We are getting the following error on a page where we have a RadDatePicker on the form during postback. I am wondering if this has something to do with differences in locale between the user and the browser but am not sure. Has anyone encountered this before?

Thanks,
Eric

--------------------------------------------

Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.
Parameter name: ticks
   at System.DateTime..ctor(Int64 ticks, DateTimeKind kind)
   at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeStringIntoDateTime()
   at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)
   at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeDictionary(Int32 depth)
   at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)
   at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer)
   at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)
   at System.Web.Script.Serialization.JavaScriptSerializer.DeserializeObject(String input)
   at Telerik.Web.UI.RadWebControl.LoadPostData(String postDataKey, NameValueCollection postCollection)
   at Telerik.Web.UI.RadDatePicker.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection)
   at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

4 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 09 Sep 2009, 03:41 PM
Hi Eric,

I'm afraid that I'm unable to recreate the behavior you have described locally. Can you please provide some more details about your RadDatePicker declaration, page setup etc?

Sincerely yours,
Rosen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Laku
Top achievements
Rank 1
answered on 20 Sep 2009, 04:55 PM
Hello,

It appears that this is happening when the client is accessing the site and their time zone is set to a value that is ahead of the clock of the server. For instance our servers are set to -6 GMT, but the client that was accessing the site was set to +5 GMT. If we set the client to -6 GMT the problem seems to go away. Do you have any suggestions?

Thanks,
Eric
0
Rosen
Telerik team
answered on 24 Sep 2009, 07:06 AM
Hello Eric,

Unfortunately I'm still unable to reproduce the described behavior locally. I have attached a simple test page, please take a look and let us know if I'm missing something obvious. You may consider sending us (attached to a formal ticket) a small runnable application in which the behavior can be observed.

Best wishes,
Rosen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Laku
Top achievements
Rank 1
answered on 26 Sep 2009, 06:56 PM
Hello,

Thanks for your help we have found the issue. In our code we were setting the MaxDate and MinDate properties to DateTime.MaxDate and DateTime.MinDate, which I guess was causing it to overflow if the client was on a different timezone that was ahead of us on postback.

Thanks,
Eric
Tags
Calendar
Asked by
Laku
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Laku
Top achievements
Rank 1
Share this question
or