Copied to clipboard

Flag this post as spam?

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


  • Eduardo Fonseca 1 post 71 karma points
    Mar 22, 2016 @ 19:16
    Eduardo Fonseca
    0

    Umbraco best practices

    Hello, I'm new to Umbraco and there are some concerns I'm having about best practices when developing using Umbraco.

    The main concern is when using SurfaceController, as far as I have seen most code samples found on the net.

    I 'm not comfortable with the views/pages executing before the controller actions and having to invoke the controller's actions from within the views.

    I'd like to know if that is the correct way to work with Umbraco, or if there is a better way to do it and keeping the default MVC behavior of executing the controller's actions first and then return to the page, avoiding having to have execution code on the views.

    Thanks.

  • Dennis Adolfi 1082 posts 6449 karma points MVP 6x c-trib
    Mar 23, 2016 @ 07:23
    Dennis Adolfi
    0

    You are probobly interested in Custom controllers: https://our.umbraco.org/documentation/reference/routing/custom-controllers

    Some reasons for this may be: to control exactly how views are rendered, custom/granular security for certain pages/templates or to be able to execute any custom code in the controller that renders the front end.

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Mar 25, 2016 @ 13:33
    Alex Skrypnyk
    0

    Hi Eduardo,

    Welcome to Our Umbraco Forum

    I would say that the best way to use SurfaceControllers - handling notAjax forms.

    In all other ways is better to use UmbracoApiController or just Templates.

    Can you provide more information what do you want to do with SurfaceControllers ?

    Thanks, Alex

Please Sign in or register to post replies

Write your reply to:

Draft