MVC in Hybrid Mode
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.
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
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.