views:

1265

answers:

7

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.

A: 

This is, I think, the interminable problem with using tools to generate HTML - you are at the mercy of what they generate. I realize that this is a non-answer, but...

Software Monkey
A: 

The sad thing is that I am rewriting this completely from scratch and it still does this. I dont even have to switch back to design view for the markup to change, this was the trigger in the previous VS instances.

Tim Daley
+1  A: 

The only answer is to not use SharePoint designer.

You can use Visual Studio, but you will have to upload the files using the web interface instead of having SharePoint Designer do it.

Nat
A: 

You're either all in to gui based design, or you're completely into editing all the code by hand. There is no inbetween for microsoft development products, it from my experience. The code editor in sharepoint designer is insufferable.

It is possible, I suppose, if you're a masochist, to just use a text editor like scite, notepad++, emacs, vi, or whatever, and code a sharepoint site entirely by hand. I've done it. I can't say it's pleasant, but it's no worse than using sharepoint designer.

Breton
+2  A: 

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.

George Durzi
George, I'm absolutely with you here. The aproach that we take is use the SharePoint Web UI, SharePoint Designer, the SharePoint Developer Explorer and tools like MetaVis (http://www.metavistech.com) to design the site, create site columns and content types etc. etc., and then export the whole thing to site definitions, list definitions, features using our custom tool. This results in a WSP package for initial deployment, from there on use techniques like content deployment and custom code for modifications on instances of sites. Site defs and content types may NOT be changed after first use.
Serge van den Oever
Did you put something special together to generate a WSP out of everything? I think that as long as you can generate a WSP - no matter how - you're doing it the "right way".To clarify, you can change Site Definitions after they've been deployed, but it's not supported, and in certain cases the changes are only applicable to new sites.When I've had to change content types, I do it by hand in the UI, or using the SharePoint object model.
George Durzi
+1  A: 

You may be able to bypass most of your use of SharePoint Designer with SharePoint Developer Explorer, and specifically the update here. I haven't tried it out but it looks like you can edit master pages and page layouts directly from within Visual Studio. Also the people that have worked on it ('The Kid' originally and Serge van den Oever with the update) know their stuff so it should be a good option for you.

Alex Angas
+1  A: 
Serge van den Oever