Change Page Title in MVC Widget with Template in Hybrid Mode
Is it possible to dynamically change a page title from either the Controller or the View when using an MVC Control on Page that is Templated in hybrid mode? I don't have a ViewBag to bubble up to.
Hi Joseph,
If you set Title in the controller's view bag Sitefinity will pick this up and set the Title of the page:
this
.ViewBag.Title =
"Some title"
;
This does not appear to be working for us in Hybrid mode on Sitefinity 6.1. Has something changed?
Following doesn't work.
this.ViewBag.Title = "Some title";
Any solution?
Hi all,
I have tested the proposed solution by Radoslav and it works fine. Here is a short video of the working widget. Please, specify what version of Sitefinity you are using. In order to use the code in the controller you should have a reference to Microsoft.CSharp.
Hope this helps.
Regards,
Nikola Zagorchev
Telerik