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

Forums / General Discussions / Master Pages

Master Pages

8 posts, 0 answered
  1. Damian
    Damian avatar
    27 posts
    Registered:
    01 Dec 2010
    22 Dec 2010
    Link to this post
    Is there any way to run code or put user controls in the master pages that sitefinity uses for a template?  Does sitefinity just take the ContentPlaceHolders on the master page, create a template out of that and not use the actual master page file?
  2. Jordan
    Jordan avatar
    172 posts
    Registered:
    20 Oct 2015
    23 Dec 2010
    Link to this post
    Hi Damian,

    Actually Sitefinity uses master pages for the layout, but you can try to run your code inline from your master page.

    Kind regards,
    Dancho
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. GCM
    GCM avatar
    11 posts
    Registered:
    29 Jul 2007
    02 Feb 2011
    Link to this post
    we're moving from 3.7 to 4.0 and in the direct translation of our master pages, it seems to do what damian described.  it doesn't use our css or other content located in the .master file, just the placeholders.  are we doing something wrong?  does it also ignore the x.master.vb file?
  4. Shawn Krivjansky
    Shawn Krivjansky avatar
    18 posts
    Registered:
    11 Jan 2010
    08 Feb 2011
    Link to this post
    Eagerly awaiting the answer to this issue myself...

    Does css, javascript, or code behind do ANYTHING when creating your own master pages and creating a template??

    What is the correct procedure?  To create your own user controls and use them and the css/javascript widgets and place them IN the template that you created (via the master page)?

    This is completely different than the 3.x days, so I think it is a pretty important concept to get some clarification on.
  5. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    08 Feb 2011
    Link to this post
    Hello guys,

    The code behind, as well as any custom/user controls are not ignored, and should be executed just fine. This means, that not only the contentplace holders are taken into account, but any control or content on the masterpages.

    Are you getting different result?

    Kind regards,
    Georgi
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Damian
    Damian avatar
    27 posts
    Registered:
    01 Dec 2010
    08 Feb 2011
    Link to this post
    I looked more into this, and code behind for master pages and any user controls on the master pages does get run normally.
  7. Liz
    Liz avatar
    13 posts
    Registered:
    01 Mar 2011
    13 Apr 2011
    Link to this post
    @Damian - Did you have to do anything special?  I am running Sitefinity 4.0.0.0 and it seems like the code behind files for my .master pages is being ignored.
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    14 Apr 2011
    Link to this post
    Hi Liz,

    There should not be a problem with executing a code behind of a master page, but the better option is using a custom and user controls.

    Regards,
    Ivan Dimitrov
    the Telerik team

8 posts, 0 answered