For the second time in as many weeks I have had the same problem with SharePoint designer and the problem has occurred in at least two separate projects.
The first time I saw the problem it was in a master page and I put it down to a bug in SharePoint Designer, caused by complex HTML. The second time however uses fairly basic HTML and is causing problems with development.
So what is the problem?
Basically SharePoint designer is reformatting the HTML, even though I am working in code view. Everytime I ’save’ or ‘open’ an .ASPX layout, SP Designer decides it wants to change the HTML I have just typed in. This is a public website with graphic designer created HTML which needs to be re-produced exactly.
The latest example is when entering a <h2> tag…SharePoint designer decides to remove the closing </h2>, which in turn ruins the layout of the page. Annoying, but you see the effect immediately and can resolve it. However on another project it was removing a </div>, which was not immediately apparent and only showed up in certain situations. To get around the problem you need to add two tags (in my case </h2></h2>) and SP Designer will only remove one of them.
To compound it further, when you open the file up again SharePoint Designer will again re-format the HTML…this time differently, removing the closing tag and adding some to the HTML.
Within a large, complicated, master page a closing tag being removed may not be immediately noticed and so you should be aware it could be caused by SharePoint designer itself.
The solution? I don’t have one…I tried changing all the settings I could…none appeared to make a difference. This is just to make you aware this can happen and it’s not just a ’slip on the keyboard’.
I have a ‘poor quality’ animated gif (3Mb) if you want to see it happening.
