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

Forums / Developing with Sitefinity / Change Master Page

Change Master Page

4 posts, 0 answered
  1. Steven Lancaster
    Steven Lancaster avatar
    82 posts
    Registered:
    06 Nov 2009
    05 Jan 2010
    Link to this post
    I have a page that is created when the link is clicked on. It is a blog it opens another window and it using the same Master Page that the referring page is using what code am I looking for to change which master page it uses? or can I do it in Sitefinity Admin.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    05 Jan 2010
    Link to this post
    Hello Steven Lancaster,

    If you want to do it programmatically, the only way to change the master page dynamically is creating a custom class that inherits from InternalPage and overriding OnPreInit where you can change the Page MasterPageFile and Theme. Let us know if your approach is different.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Steven Lancaster
    Steven Lancaster avatar
    82 posts
    Registered:
    06 Nov 2009
    05 Jan 2010
    Link to this post
    I have a custom class a .ascx file and would like to use it to change the master page.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    06 Jan 2010
    Link to this post
    Hello Steven Lancaster,

    The .ascx is used for controls, you have to create a custom class that inherits from InternalPage as suggested in the previous reply. The user control will not do the trick.

    public class Class22 : InternalPage
    {
        public Class22()
        {
         
        }
          ....
                ....
    }

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
4 posts, 0 answered