Using Ajax call to controller action method in Sitecore 9.1.1
I was working on a requirement where most of the task needs to be accomplished by ajax call to controller action method .As it is sitecore solution so no direct call to controller action was working for me .
what next then ?
Answer is sitecore pipeline .
Let’s see how by using pipeline my controller action call using ajax started working .
Step 1 : Add a pipeline config file to a specific feature project as follows :
Step 2 : Add a route config class as follows and map the controller action method accordingly :
Step 3: Register the route config class:
Step 4 : Ajax call to controller action method :
in sitecore project direct ajax call to controller action is not working so its always better to use pipeline and register the routes .
Happy Learning..