MVC in Hybrid Mode

Posted by Community Admin on 04-Aug-2018 03:37

MVC in Hybrid Mode

All Replies

Posted by Community Admin on 08-Apr-2013 00:00

Sitefinity 5.4
I have a dynamic module called 'Apps'. These Apps are grouped into categories. 
I have a page for each category - which I use to show dynamic single item detail content for an app in that Category. This is through the widget provided by the module builder.

The url would be e.g. example.com/.../Accounts
where the category is "Financial" and the App identifier is "Accounts"

I would like to use MVC in hybrid mode to include an additional custom MVC widget on the page, but I'm having trouble pulling this all together. My controller action fires correctly on a static page, but not on my dynamic app page.
If I browse to example.com/.../Financial, then my controller fires, but then I don't get the other detail content through the sitefinity dynamic widget. 

The signature for my controller action method is...

   [ControllerToolboxItem(Name = "GetApp", Title = "Get This App", SectionName = "xxx")]
    public class GetAppController : Controller
   
        private GetAppViewModel model;

        public ActionResult Index(string id)
        ...
       

I've added a Global.asax to add a route for my action, with code behind as....


        void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs args)
       
            if (args.CommandName == "RegisterRoutes")
           
                var routes = ((EnumerableQuery<RouteBase>)args.Data).ToList();
                var newRoutes = new RouteCollection();
                newRoutes.MapRoute("Apps", // Route name
                       "Apps/product/id", // URL with parameters
                       new controller = "GetApp", action = "Index", id = UrlParameter.Optional ); 
                routes.Add(newRoutes[0]);
           
       

Any suggestions gratefully received.

Posted by Community Admin on 10-Apr-2013 00:00

Hi,

We have answered you on the supported ticket you have opened. You could share our answer with the community if you want.

Greetings,
Stefani Tacheva
the Telerik team

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

Posted by Community Admin on 17-Apr-2013 00:00

Thank you Stefani. I also received assistance from Vesselin Vasilev who directed me to Stanislav Velikov's blog post how-to-display-mvc-widget-in-detail-views-of-content-items. This post provided exactly the info that I needed.

This thread is closed