none
How to associate custom masterpage from 12 hive folder to an ASPX page

    Question

  • scenario: I have a custom masterpage available within 12 hive folder. 

    I want one of the ASPX pages (say allitems.aspx) to use this masterpage. I see that when I open the ASPX page using SPD, it has default.master but upon changing it to mydefault.master it gives error indicating that file is not found.

    So question is how to reference custom masterpage in aspx pages? I prefer to do it through visual studio but SPD is also fine.

     

    thanks.

    Friday, September 17, 2010 4:25 PM

Answers

  • Hi Anirudh,

    I dont understand, what problem you are finding here. In my previous posts, i have told you that how master page can load into a site collection (i.e. Import method)

    I have also told that you can apply any master page on any page through SPD.

    Follow below steps:

    open your site in SPD and choose your list from list folder. If you want to apply your master page only on Allitems.aspx page of a particular list then check out this page and find below tag

    <%@ Page language="C#" MasterPageFile="~masterurl/default.master"

    Apply your custom master page instead of default.master.

    Is it helpful.


    Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"
    • Marked as answer by Anirudh123 Monday, September 27, 2010 1:23 PM
    Friday, September 24, 2010 3:45 AM

All replies

  • Have you tried uploading your custom master page to the Master Page Gallery through the SharePoint UI (Site Actions > Site Settings) then changing the reference in the .aspx page?

    Chanda

    Friday, September 17, 2010 8:39 PM
  • Yes I did that. I then opened the ASPX page using SPD and tried to reference this masterpage but it is not working. Is there a way to directly reference this file from 12 hive folder in this ASPX page? 

    thanks.

    Friday, September 17, 2010 8:59 PM
  • Hi Anirudh123,

    Thanks to share your problem.

    Have you tried with Import / Export feature through SPD. If not then try it

    Office SharePoint Designer 2007.
    1. Open SharePoint Designer
    2. On the File menu, click Open Site.
    3. In the Open Site dialog box, type the URL of the
    site that you want to open in the Site name box,
    and then click Open. 
    4. Import the master page files into your site.  
        a. On the File menu, select Import > File...
        b. In the Import dialog box, select Add Folder...
        c. Browse to location of the extracted master page files, and then browse to a specific master page set
        d. Select the "_catalogs" folder and click open
        e. Repeat steps for the "images" folder and style sheet and then Click ok to finish importing the files.


    Please let me know if it works


    Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"
    Monday, September 20, 2010 5:02 AM
  • I have not tried above steps but before I try few questions,

     

    a) as per your step (c) do I need to set the masterpage as 'default'?

    b) Also if I do not want to import the files to SPD, isn't there any other way of directly referencing the masterpage from 12 hive folder?

    thanks.

    Monday, September 20, 2010 1:06 PM
  • Hi Anirudh,

    Thanks for reply.

    1. Yes, Once you import your master page in your site then you need to make it "Set as default master page". You can also apply your custom master page through browser.

    2. There should be a way to do this but i have not tried yet. you may check below url to get your answer

    http://www.heathersolomon.com/blog/articles/servermstpageforsitecollect.aspx

    Hope this will help you


    Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"
    Tuesday, September 21, 2010 3:55 AM
  • Hi,

     

    1) I do not want to set one of the masterpage as default as it would change the masterpage for whole site. I am looking to use one of the custom masterpages (Deployed in 12 hive folder) on some of the OOB aspx pages.

    Please suggest.

    Wednesday, September 22, 2010 3:42 PM
  • Hi Anirudh,

    I don't think it is possible to change look and feel of some OOB pages. If you want to do it then create your own .aspx page and apply own style sheet.

    By the way, which page you want to modify, can you explain??


    Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"
    Thursday, September 23, 2010 6:05 AM
  • I am planning to apply my custom masterpage (from 12 hive folder) to allitems.aspx of a standard list.
    Thursday, September 23, 2010 1:04 PM
  • Lets look into it

    http://office.microsoft.com/en-us/sharepoint-designer-help/create-a-custom-list-form-HA010119111.aspx


    Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"
    Thursday, September 23, 2010 2:48 PM
  • I think the link you mentioned is to know ways of creating new ASPX page. 

    What I am looking for it to apply masterpage to one of the already available pages such as AllItems.aspx.

     

    Thursday, September 23, 2010 2:55 PM
  • Hi Anirudh,

    I dont understand, what problem you are finding here. In my previous posts, i have told you that how master page can load into a site collection (i.e. Import method)

    I have also told that you can apply any master page on any page through SPD.

    Follow below steps:

    open your site in SPD and choose your list from list folder. If you want to apply your master page only on Allitems.aspx page of a particular list then check out this page and find below tag

    <%@ Page language="C#" MasterPageFile="~masterurl/default.master"

    Apply your custom master page instead of default.master.

    Is it helpful.


    Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"
    • Marked as answer by Anirudh123 Monday, September 27, 2010 1:23 PM
    Friday, September 24, 2010 3:45 AM
  • HI Anirudh,

    I got your problem you could not assign master page directly 12 hive to list forms. So you can do one thing to solve this issue create list definition and change Allitems.aspx to apply the 12 hive masterpage. You can use sharepoint solution generator to create list definition of particular list.

    Now deploy that listdefinition to sharepoint site and create list from that definition where you can see list form with 12 hive master page applyed.

    Hope this will helpful.


    Thanks Shrivallabh Kulkarni
    Friday, September 24, 2010 10:07 AM
  • Master page can be refered from 12 hive folder.

    Please check the path that you have provided.

    if still there is problem, put the complete path c:/program files/ common files/..../12/, and then check.

    If this will work then try to change it with relative path.


    Prakash
    Friday, September 24, 2010 11:07 AM