AJAX ListView not calling controller actions in .NET Core

3 posts, 0 answers
  1. Adam
    Adam avatar
    7 posts
    Member since:
    Jun 2016

    Posted 24 Jul Link to this post

    public class FavoritesController : Controller
        {
            public IActionResult Favorites_Read([DataSourceRequest] DataSourceRequest request)
            {
                ...

                return Json(listings.ToDataSourceResult(request));
            }
        }

     

    @(Html.Kendo().ListView<ListingDetails>()
        .Name("listView")
        .TagName("div")
        .ClientTemplateId("listingTemplate")
        .Pageable()
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(5)
            .Model(model => model.Id(p => p.ID))
            .Create(update => update.Action("Favorites_Create", "Favorites"))
            .Read(read => read.Action("Favorites_Read", "Favorites"))
            .Update(update => update.Action("Favorites_Update", "Favorites"))
            .Destroy(update => update.Action("Favorites_Delete", "Favorites"))
        )
        .Deferred()
        )

     

    I've set a breakpoint at the beginning of Favorites_Read, but the action is not being hit. Any help would be greatly appreciated.

  2. Adam
    Adam avatar
    7 posts
    Member since:
    Jun 2016

    Posted 24 Jul in reply to Adam Link to this post

    I should mention that I am also not getting any javascript errors on load.
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1803 posts

    Posted 27 Jul Link to this post

    Hi Adam,

    Can you please test the same without the Deferred and see if it will make any difference? If it does, please ensure that you are calling the DeferredScripts method as documented in the following help article:
    I am looking forward to your reply with the results.


    Regards,
    Konstantin Dikov
    Telerik by Progress
    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