Having single default action method for mvc widget

Posted by Community Admin on 04-Aug-2018 16:21

Having single default action method for mvc widget

All Replies

Posted by Community Admin on 13-Jun-2013 00:00

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? 

Posted by Community Admin on 18-Jun-2013 00:00

Hi,

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.

Regards,
Stanislav Velikov
Telerik

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

This thread is closed