I just tried to access umbraco surface controller from jquery ajax call.
But its not fired, any one please let me know how to call umbraco surface controller via ajax
eg: i have controller called EmployeeSurfaceController, in this i need to invoke getEmployees action method.
If your surface controller is inheriting from UmbracoAuthorizedJsonController, you will not be able to call it using ajax unless you are logged in[or pass credentials]. If you are able to post your surface controller class, it would help in narrowing down the issue.
Call Surface controller from ajax call
Hi,
I just tried to access umbraco surface controller from jquery ajax call. But its not fired, any one please let me know how to call umbraco surface controller via ajax
eg: i have controller called EmployeeSurfaceController, in this i need to invoke getEmployees action method.
Regards, Thomas
Hi Thomas,
this would be an example ajax call:
For more information:
https://www.w3schools.com/jquery/ajax_ajax.asp
https://our.umbraco.com/documentation/reference/routing/surface-controllers
Jonathan
If your surface controller is inheriting from UmbracoAuthorizedJsonController, you will not be able to call it using ajax unless you are logged in[or pass credentials]. If you are able to post your surface controller class, it would help in narrowing down the issue.
I have used ajax previously to get data from a surfacecontroller.
is
employeesurface
==employeesurfacecontroller
in your namespace? Can you post your controller code or an example please?Also make sure the function
getemployees
is public with[HttpGet]
access.is working on a reply...