locked
How can sharepoint designer automatically delete my webparts? RRS feed

  • Question

  • Hi All,

    I have a SP 2007 site that I work on with SPD 2007 (free version) and I'm finding that SPD will often delete webparts when switching from code view to design view when working with webparts.

    I have a customized master page with one asp content area.

    The page in question is a ceo blog type page where it contains an article text, displays user comments under the text and has a submission form under the comments.  Pretty straight forward...

    Problem is, after adding the webpart zones and the submission form, I am displaying the comments using the XSLT view and customizing the display.  The customization is a simple table breaking up the replies and a bit of CSS.  Once i add the code in the code view and switch back to design to view it, I end up with 2 webpart zones and all my code is gone?!

    Below is the code from the code view for the xsl template...  Any help on why SPD keeps crashing would be really helpful.

    Thanks

    <xsl:template name="dvt_1.rowview">
    
     <table width="100%" cellpadding="5" cellspacing="0" style="border:1px solid #031944;" border="0">
    
      <tr>
    
      <td style="width:5%; background-color:#e5f2fe;" align="left"><img src="../../graphics/users.gif" alt="" /></td>
    
      <td style="width:10%; background-color:#e5f2fe;" align="left"><b>Name:</b></td>
    
      <td style="width:20%; background-color:#e5f2fe;" align="left"><xsl:value-of select="@Name" /></td>
    
      <td style="width:12%; background-color:#e5f2fe;" align="left"><strong>Submitted:</strong></td> 
    
      <td style="background-color:#e5f2fe; width:53%" align="left"><xsl:value-of select="ddwrt:FormatDate(string(@Submitted),number($Language),5)" /></td>  
    
      </tr>
    
      <tr>
    
      <td align="left" colspan="5"><b>Comments:</b><br />
    
       <xsl:value-of select="@Comments" disable-output-escaping="yes" />
    
      </td>
    
      </tr>
    
     </table><br /> 
    
     <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
    
      <tr>
    
      <td align="center" class="ms-vb">
    
       <span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view" />
    
      </td>
    
      </tr>
    
     </xsl:if>
    
     </xsl:template>

     

    • Edited by Mike Walsh FIN Tuesday, March 15, 2011 7:16 PM Title revised. Do not write Help with in Titles. There is no "free version" of SPD 2007 - that is the only version.
    Tuesday, March 15, 2011 4:54 PM

Answers

  • Hi Brad1978,

    How about save it before turn to design view?

    General condition, a badly written code will not render in Design/Split view. But I tested your code, for this part of code, it works on my computer. Please check the master page out when you do a customization. And also check your permission in SharePoint designer.
    Do you a site manager or contributor?
    If you are a contributor, you will not allowed to insert/edit/delete Web part zones/web parts outside of web part zones/Data views/Data forms in default settings. Please ask a site manager to modify/check your permissions in SharePoint designer in Site > Contributor Settings > select the groups you belong to > Modify > SharePoint tab > give appropriate permissions.
    For the details about restrict the use of code view, please read this
    reference.

    Best regards,
    Emir

    • Marked as answer by Leoyi Sun Thursday, March 24, 2011 3:25 AM
    Thursday, March 17, 2011 7:50 AM