+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Change Page Title in MVC Widget with Template in Hybrid Mode

Change Page Title in MVC Widget with Template in Hybrid Mode

5 posts, 0 answered
  1. Joseph
    Joseph avatar
    1 posts
    Registered:
    11 Aug 2011
    22 Mar 2013
    Link to this post
    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. 
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    25 Mar 2013
    Link to this post
    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";

    Greetings,
    Radoslav Georgiev
    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
  3. Ryan
    Ryan avatar
    2 posts
    Registered:
    23 Jul 2010
    20 Sep 2013
    Link to this post
    This does not appear to be working for us in Hybrid mode on Sitefinity 6.1. Has something changed?
  4. Saad
    Saad avatar
    98 posts
    Registered:
    10 Oct 2008
    01 Jul 2014 in reply to Radoslav Georgiev
    Link to this post

    Following doesn't work.

    this.ViewBag.Title = "Some title";

    Any solution?

  5. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    Registered:
    24 Nov 2016
    02 Jul 2014
    Link to this post
    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
     
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
5 posts, 0 answered