Suppose I have two files, A, and B respectively.

Everytime I copy xsl code from file A to B and modify the code in B and save it. The code in A gets removed (all except for the WebPartZone tags and a other). I don't know how to fix this. I can't progress with my project if I cannot have code in both files.

I can reassure you:

All of the tags are properly matched. It is the correct ListID (I want to use the same Document Library for both files) To confirm that it is the copying and pasting, I copied, and pasted a similar, really old page.

A page full of fully functional code is left with empty tags, the following code is an example of the resulting file (I've excluded the file tags at the top):

<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">

<asp:ScriptManagerProxy runat="server" id="ScriptManagerProxy">
<WebPartPages:SPProxyWebPartManager runat="server" id="spproxywebpartmanager"></WebPartPages:SPProxyWebPartManager>

<table cellpadding="0" cellspacing="0" border="0" width="100%">


<td align="left" valign="top">
<WebPartPages:WebPartZone id="WPZ01" runat="server" title="WPZ01"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>



<asp:Content id="Content1" runat="server" contentplaceholderid="PlaceHolderTitleAreaClass">


Please pardon my ignorance I am new to SharePoint. I really appreciate the assistance. If you have an idea of where I can start trouble shooting this issue, that would be just as helpful.

  • Instead of copying and pasting, saving A as B works and doesnt delete the code in A. Took me long enough to figure out =.=
    – MyName
    Commented Jan 24, 2012 at 17:33

1 Answer 1


I always keep .txt backup file of whatever I create with SPD. I has saved me many times exactly because of SPD being a bit too helpful and adding attributes, etc. without asking me.

Also, sometimes it helps to keep the file open and check it in in another tab.

Quite often restarting SPD helps to cure this behavior.

And finally, taking copy of the file content, creating new file and pasting the content there sometimes fixes things (then just rename old and new to make the replacement of the files).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.