Hello I am coming from Kendo for Core. I am trying to get data from the database but im not sure where im going wrong.
Here is my controller action and the call from the webpage.
public IActionResult GetRoles()
{
var Roles = _context.AspNetRoles.ToList();
return Json(Roles);
}
$("#grid").kendoGrid({
dataSource: {
type: "json",
transport: {
read: '../Admin/GetRoles'
},
pageSize: 20
},
This works locally but when i publish to the server it cannot find the method. I looked at the service they have posted but im not sure what i would need to do.
local does give an error but the data shows
kendo.all.js:2178 Unknown DataSource transport type 'json'.Verify that registration scripts for this type are included after Kendo UI on the page.
There is no built-in transport type "json". Here is the list of the available ones: https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/type.
This configuration defaults to the default transport type which should be fine for the case. As for why the action is not found I can only assume that when the application is published it navigates to the incorrect route. I suggest you trying to use Url.Action helper:
If this does not help, double-check whether you can access the action without the grid and see if it is a valid route.