Copying code over in Sharepoint Designer 2010 and changing it, deletes code from the original file, how can I fix this

sharepoint.stackexchange https://sharepoint.stackexchange.com//questions/27634

Question

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.

Était-ce utile?

La solution

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top