web api Register

arbab anis asked on August 17, 2017 10:59

Hi i am using web app and i have created the class library project with control i am confuse how to register the routing "In your startup logic, register custom routes that do not conflict with Kentico's 'cmsapi' or any other page paths." how exactly i should register i also didn't find app_Code there is a oldapp_Code

Recent Answers


Suneel Jhangiani answered on August 17, 2017 14:03

Since you are using Kentico as a Web App the App_Code folder is called OldApp_Code. This is due to the fact that a web site project uses JIT compilation and hence you can just upload the source and it will compile it on the fly, whilst a Web App project should be pre-compiled and then uploaded to the server.

As for registering routes, that would depend on what you are doing in your custom library. If you are just creating some Controls (such as a form conrtol or a Web Part) you will not need to register a route as you specify the path to the control or web part when defining it in Kentico. However, if you are implementing a custom API then you should register the route to your custom API so that Kentico knows your code should run when that URL is accessed.

For an example of using a custom route have a look at http://www.mcbeev.com/Blog/September-2014/How-to-Connect-Disqus-Comments-to-Kentico-EMS-Activity-Tracking

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.