Just tried to put a simple RadScheduler with webservice binding in an usercontrol, but get a javascript error when loading the page. the error says "The server method 'GetAppointments' failed." the "OnClientRequestFailed" is fired as well. If I put the same radscheduler control directly in a aspx page, it works fine. Is there any specific settings for such scenario? Thanks in advance.
ascx code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Scheduler.ascx.cs" Inherits="Usercontrols_Scheduler" %>
<
telerik:RadScheduler
ID
=
"RadScheduler1"
runat
=
"server"
AppointmentStyleMode
=
"Default"
SelectedView
=
"WeekView"
Width
=
"100%"
Height
=
"100%"
Culture
=
"en-AU"
WeekView-HeaderDateFormat
=
"d/MM/yyyy"
TimelineView-HeaderDateFormat
=
"d/MM/yyyy"
TimelineView-ColumnHeaderDateFormat
=
"ddd d/MM"
AdvancedForm-ZIndex
=
"7002"
>
<
AdvancedForm
Modal
=
"true"
/>
<
TimelineView
NumberOfSlots
=
"7"
/>
<
WebServiceSettings
Path
=
"../SchedulerWebService.asmx"
ResourcePopulationMode
=
"ServerSide"
/>
</
telerik:RadScheduler
>
aspx page (parent page):
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="Forms_MasterData_test" %>
<%@ Register Src="../../Usercontrols/Scheduler.ascx" TagName="Scheduler" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"RadScriptManager1"
>
</
telerik:RadScriptManager
>
<
div
>
<
uc1:Scheduler
ID
=
"Scheduler1"
runat
=
"server"
/>
</
div
>
</
form
>
</
body
>
</
html
>
10 Answers, 1 is accepted
It looks like the path in the WebService settings needs to be changed as well when you move the code to the user control.
Hope this will help you.
Plamen Zdravkov
the Telerik team

I am attaching a sample project that implements a RadScheduler within a user control that is bound to WebService that worked properly at my side. Please review it and if you still observe the unusual behavior please let me know what other code should I add to the project in order to reproduce it locally.
Hope this will be helpful.
Plamen Zdravkov
the Telerik team

Thanks for the sample and sorry for the late reply. I found the error only happens when using the user control in pages located in customer sub folders, in your sample, I added a page to wetsite\Forms\MasterData path, and the same error just pops up. Please find the attached screen shots.
Thanks in advance,
Jason
It seems that this behavior appears when you set the path to the WebService method in the UserControl that is in another directory. In order to prevent this I will recommend you to move the UserControl in the MasterData folder as shown here as well and change the reference:
<%@ Register src="~/Forms/MatserData/SchedulerControl.ascx" tagname="SchedulerControl" tagprefix="uc1" %>
Hope this will be helpful.
All the best,
Plamen Zdravkov
the Telerik team

What is the root cause for the issue? how to use the same user control for pages in other folders?
Regards,
Jason
It seems that when you put your user Controls in another directories and when the WebService method is called it can not be found because different path is generated which is confusing the functionality.
Hope this will explain the issue.
Plamen Zdravkov
the Telerik team

The common practice is to place user controls in a folder and use them in any pages from any folders. the suggested workaround to put the user control in the page folder means the same user control will need to be copied to all directories which containing pages with the uc registered. is this a known bug in the current release?
Regards,
Jason
It seems that I have made a mistake while inspecting the issue. Please excuse me for this confusion. I am attaching the sample project that uses the RadScheduler as a user control as in the image attached in the post from 25 of June.
Hope this will solve the issue.
Plamen Zdravkov
the Telerik team
