Copied to clipboard

Flag this post as spam?

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


  • Bilal khan 35 posts 58 karma points
    Jan 26, 2015 @ 16:26
    Bilal khan
    0

    Creating a new Controller action 404's

    Hi,

    I am using hybrid framework as the base. I have a controller call Article. I want to add a new Action Method ajaxableArticle. Now the Index action method work fine when I call Article page. But when I try to hit ajaxable article its give me a 404.

    localhost/article/ajaxableArticle (404's)

     

    I am not sure what I am doing wrong here (FYI I am new to umbraco so please forgive me if that;s a stupid question)

     public ActionResult Index()

            {

                var model = ModelLogic.CreateMasterModel() as MasterModel<Home>;

                if (model == null) return null;

     

                return CurrentTemplate(model);

            }

            public ActionResult ajaxableArticle()

            {

                var model = "test";

                return CurrentTemplate(model);

            }

     

    Many thanks

    Ad

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Jan 27, 2015 @ 12:15
    Jeroen Breuer
    0

    Hello,

    Since you're using the Hybrid Framework I assume that your controller is a SurfaceController. In that case you can try the following url:

    /umbraco/surface/article/ajaxableArticle

    For this to work the name of your ActionResult needs to be AjaxableArticle and the name of your Controller ArticleController.

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft