locked
Editing Master Page with SharePoint Designer 2007 Causes Error. RRS feed

  • Question

  • I'm using SharePoint Designer to modify our master page (default.master).  However, whenever I open the Master Page in Designer, the program modifies two lines of code and saves it back to the file automatically without prompting (literally, if you blink you'll miss the change).  These changes Designer makes causes the Master Page to completely break.

    <%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %>
    <%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/Welcome.ascx" %>

    Get changed to:

    <%@ Register TagPrefix="wssuc" TagName="Welcome" src="_controltemplates/Welcome.ascx" %>
    <%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="_controltemplates/Welcome.ascx" %>

    Notice that the ~/ gets removed.  How can I prevent Designer from doing this?

    In order for me to modify the Master Page, I have to make my changes in Designer, save and close and then reopen in Text Pad and replace the ~/ and then upload and check it in.

    Wednesday, August 10, 2011 8:05 AM

Answers

  • Ok, that's the case when you work outside the content database with a aspx file in SharePoint Designer, but if you just open the master page directly inside Designer and do your modifications, you will not have this issue with the tilde.
    / C
    Blog: chrisstahl.wordpress.com Twitter: @Cstahl
    Wednesday, August 10, 2011 3:49 PM

All replies

  • Hi Dave, do you open a file that can be customized with SharePoint Designer? Open SPD first, and after that open the site you need to modify. You cannot open modify pages in 12 hive with SPD, it´s that the case here?
    /C
    Blog: chrisstahl.wordpress.com Twitter: @Cstahl
    • Edited by Christian Stal Wednesday, August 10, 2011 1:37 PM wrong grammar
    Wednesday, August 10, 2011 1:36 PM
  • What I do is download a copy of the default.master from the Master Page and Layout Gallery.  I open that copy from Designer and make my changes.  From there, I upload the modified version back into the Gallery and check it in, publish a major version and approve it.

    The problem I am having is that SPD is making changes to the file and saving them back automatically without notification.  The changes that are being made, cause the Master Page to break.  So, before I do the final upload, I have to go in and make corrections using Notepad or Wordpad. 

    I do not access any pages in the 12 hive.

    Wednesday, August 10, 2011 2:35 PM
  • Ok, that's the case when you work outside the content database with a aspx file in SharePoint Designer, but if you just open the master page directly inside Designer and do your modifications, you will not have this issue with the tilde.
    / C
    Blog: chrisstahl.wordpress.com Twitter: @Cstahl
    Wednesday, August 10, 2011 3:49 PM