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

2 posts, 0 answers
  1. Rafe
    Rafe avatar
    9 posts
    Member since:
    Feb 2014

    Posted 21 Sep 2015 Link to this post

    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?

  2. Plamen
    Plamen avatar
    2810 posts

    Posted 24 Sep 2015 Link to this post


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

    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
Back to Top