Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Akeem 43 posts 198 karma points
    Mar 22, 2016 @ 18:00

    Umbraco Ajax load more onclick of a button using surfacecontroller

    Please can anyone help me . I am trying to use Ajax for to load more calendar event thats coming from my umbraco backend . from this code below

    enter image description here

    public ActionResult LoadEvent(int number)
        var model = Umbraco.Content(1121).eventDetails;
        return model;

    My SmartController is located inside App_Code folder . Below is the Ajax am working on

    $(document).ready(function (e) {
    $(".buttonListener").click(function () {
            //  e.preventDefault();
                url: "/SmartController/SmartSurface",        //"/SmartCalendar",
                data : {number: 1},
                success: function (data) {
                error: function () {
                    alert("Ka pow!");
            return true;


    Please help me somebody ....

  • Dennis Adolfi 1071 posts 6354 karma points MVP 2x c-trib
    Mar 23, 2016 @ 07:28
    Dennis Adolfi

    Hi Akeem. I would probobly prefer to return a ViewModel as JsonResult to my view. Looking your above ActionResult, it looks like you are returning the complete dynamic model to the view. It´s probobly better to return a viewmodel with the properties that you want to use in the front end.

    Se my response to this question for a working ajax example:

  • Dave Woestenborghs 3232 posts 10955 karma points MVP 5x admin c-trib
    Mar 23, 2016 @ 07:47
    Dave Woestenborghs

    Hi Akeem,

    Can you post the entire code of your controller ? If it's a surface controller and the name is SmartSurfaceController then the url should be :


    Have a look at the documentation of Surface controllers and especially the part about routing :


Please Sign in or register to post replies

Write your reply to: