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?
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>
<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>