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

web api when scheduler page isn't in site root directory

1 Answer 53 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Rafe
Top achievements
Rank 1
Rafe asked on 21 Sep 2015, 12:04 PM

So all the examples that Telerik provides for binding Scheduler to WebApi have the aspx page in the root of the application, and the Web Api route with the end point where the path starts with "api", which since it does not contain a / at the beginning makes the requests to the api relative to whatever is calling it. That works fine until you no longer have the scheduler control on a page in the root of the web application. If the scheduler is on a page a /mysubfolder/page.aspx, then the scheduler is going to try to access the Web Api via /mysubfolder/api/..., which doesn't match the Web Api route.

So okay, we just update the Path to the WebServiceSettings to make it absolute (Path="/api/scheduler"). Well this doesn't work because there's explicit logic in the RenderingManager js that checks if the path starts with "api", and only applies the Web Api js logic if that is the case. Since the path has a / at the beginning, the js does not apply the Web Api logic. Manually setting the _isWebApi property to true doesn't appear to be enough to get it working.

Are there any full Web Api binding examples you can provide that show how to bind the Scheduler when it isn't in the root directory of the site?

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 24 Sep 2015, 07:36 AM
Hello,

I am attaching a sample page that worked correctly at my side. 

Regards,
Plamen
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Scheduler
Asked by
Rafe
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or