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

Handling Time Zones

1 Answer 79 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Derek Feng
Top achievements
Rank 1
Derek Feng asked on 15 Jun 2010, 09:21 PM
I am following the example in "Handling Time Zones" in the documentation for RadScheduler to use JavaScript and asynchronous AJAX requests to discover the time zone on the client. I copied the following block of code into my ASP page (see the code below).
But when I compile, I always get an error saying, "The name 'RadAjaxManager1' does not exist in the current context ".
I do have the RadAjaxManager in the ASP page and its ID is "RadAjaxManager1".  And I have RadAjaxLoadingPanel in my code, too. I tried to put the block of code in different location of the ASP page, but it did not help.
Also, if I removed reference to "RadAjaxManager1" in the following block of code, I would get another error on ajaxPanel.Show, saying "the object does not support the method".

What did I do wrong?

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 
<script type="text/javascript">
   
var syncComplete = false;   
   function SynchronizeClientTimeZoneOffset()
   {
     if (!syncComplete)
     {
       var ajaxPanel =
<%= RadAjaxLoadingPanel1.ClientID %>;
       var schedulerId = '
<%= RadScheduler1.ClientID %>';
       ajaxPanel.Show(schedulerId);     
       var now = new Date();
       var offset = now.getTimezoneOffset()
       InitiateAsyncRequest(-offset);     
       ajaxPanel.Hide(schedulerId);     
       syncComplete = true;
     }
   }   
   function InitiateAsyncRequest(argument)
   {
      var ajaxManager =
<%= RadAjaxManager1.ClientID %>;
      ajaxManager.AjaxRequest(argument);
   }
   
   Sys.Application.add_load(SynchronizeClientTimeZoneOffset);
  
</script>       
</telerik:RadCodeBlock>

1 Answer, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 21 Jun 2010, 01:44 PM
Hi Derek Feng,

I'm not sure what can cause this problem by the provided info from you.

In the attached .zip file you can find the full code of the "Time Zones" demo.

Please take a look at it and feel free to contact us if you still need some help. But next time please attach the full code so we to be able to help you.

Regards,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Scheduler
Asked by
Derek Feng
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Share this question
or