SharePoint Designer Reformatting HTML on the fly, able to disable?

Tim Daley picture Tim Daley · Jan 16, 2009 · Viewed 8.4k times · Source

Before I tear what is left of my hair out I have been trying to modify some master pages in SharePoint Designer and whenever I make HTML markup changes it reformats them as it see's fit. For example, I am trying to make the code readable so I am moving items to their own lines and such. As soon as I save it moves everything back to a single line of code.

This was a problem that I had with VS2003 & VS2005, until VS2005 SP1. Unfortunately this makes it very cumbersome to ever read or decipher what the HTML markup is. Does anyone know how to disable this automatic reformatting of HTML in SharePoint Designer?

My alternative would be to use VS2008 but when attempting to load the SharePoint web site I recieve an error that Visual Web Developer cannot open SharePoint sites. So apparently that is a no go. Is there any alternative to SharePoint Designer or are you stuck with that and having it reform your markup at its leisure?

Thank you for your time.

Answer

George Durzi picture George Durzi · Jan 20, 2009

I only use SharePoint Designer when I want to see the effect of a change (e.g. to a master page) immediately, without having to retract/deploy a solution just to do so.

While it takes longer, I author all my HTML in Visual Studio, and paste into SharePoint Designer if I need to. I NEVER paste from SharePoint Designer back into Visual Studio, since the tool tends to butcher the HTML and add to it just so it can open it.

Having said that, it's important to understand when (and when not) to use SharePoint Designer. You should be creating SharePoint Solutions for all your assets, e.g. master pages and CSS files.

If you open and edit one of these in SharePoint Designer, remember that you are unghosting/customizing them. This means that the file now lives in the content database instead of on disk. This might affect the performance of your website.

Also remember that SharePoint Designer doesn't understand server side code. So if you have a Page Layout that has a code behind, editing it in SharePoint Designer will break it.