Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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">
</asp:ScriptManagerProxy>
<WebPartPages:SPProxyWebPartManager runat="server" id="spproxywebpartmanager"></WebPartPages:SPProxyWebPartManager>

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


<tr>

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


</tr>

</table>

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



        </asp:Content>

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.

share|improve this question
    
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 Jan 24 '12 at 17:33
add comment

1 Answer 1

up vote 0 down vote accepted

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).

share|improve this answer
    
thank you _______________ –  MyName Feb 22 '12 at 17:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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