SharePoint Designer 即时重新格式化 HTML,可以禁用吗? [英] SharePoint Designer Reformatting HTML on the fly, able to disable?

查看:21
本文介绍了SharePoint Designer 即时重新格式化 HTML,可以禁用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我撕掉剩下的头发之前,我一直在尝试修改 SharePoint Designer 中的一些母版页,每当我进行 HTML 标记更改时,它都会按照它认为合适的方式重新格式化它们.例如,我试图使代码可读,所以我将项目移动到他们自己的行等.我一保存就将所有内容移回一行代码.

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.

这是我在使用 VS2003 & 时遇到的问题VS2005,直到 VS2005 SP1.不幸的是,这使得阅读或解读 HTML 标记是非常麻烦的.有谁知道如何在 SharePoint Designer 中禁用这种自动重新格式化 HTML 的功能?

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?

我的替代方案是使用 VS2008,但在尝试加载 SharePoint 网站时,我收到一个错误,提示 Visual Web Developer 无法打开 SharePoint 网站.所以显然这是不行的.是否有 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?

感谢您的宝贵时间.

推荐答案

我只在想要立即查看更改(例如,母版页)的效果时才使用 SharePoint Designer,而无需撤回/部署解决方案这样做.

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.

虽然需要更长的时间,但我在 Visual Studio 中创作了所有 HTML,并在需要时粘贴到 SharePoint Designer 中.我从不从 SharePoint Designer 粘贴回 Visual Studio,因为该工具倾向于删除 HTML 并将其添加到其中,以便它可以打开它.

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.

话虽如此,了解何时(以及何时不)使用 SharePoint Designer 很重要.您应该为所有资产创建 SharePoint 解决方案,例如母版页和 CSS 文件.

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.

如果您在 SharePoint Designer 中打开并编辑其中之一,请记住您正在取消托管/自定义它们.这意味着该文件现在位于内容数据库中,而不是在磁盘上.这可能会影响您网站的性能.

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.

另请记住,SharePoint Designer 不理解服务器端代码.因此,如果您的页面布局背后有代码,则在 SharePoint Designer 中对其进行编辑会破坏它.

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.

这篇关于SharePoint Designer 即时重新格式化 HTML,可以禁用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆