Try Now
More in this section

Forums / Developing with Sitefinity / Having single default action method for mvc widget

Having single default action method for mvc widget

2 posts, 0 answered
  1. Andrew Stephen
    Andrew Stephen avatar
    2 posts
    13 Jun 2013
    13 Jun 2013
    Link to this post
    Is it possible for an mvc widget to have only one method (presumably Index()) to be called for all subpages. I have a page with two mvc widgets. One mvc widget has multiple action method while the other has only the default action method. When the user goes to a subpage (an action method in the first controller), the controller with only the default action method does not get called. Is there a way for the controller to force all action invocation to a default action method so that I don't need to declare another method for every subpage of the first "multi-actioned" controller? 
  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    27 Oct 2016
    18 Jun 2013
    Link to this post

    The issue here is that when an action is invoked from one of the controllers they redirect to this controller and the page url becomes "/page/controllerActionOne" and on the route /page/controllerActionOne the second controller is not existing, its existing on route /page . Attached are two widgets that call their actions trough async requests without changing the route, please test if this is suitable for your scenario.

    I also suggest you to check the Sitefinity MVC webinar here and you will answer your questions about the routing, how does Sitefinity process the MVC requests and how does the hybrid mode works exactly.

    Stanislav Velikov
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered