13.5. A Few Tips and Tricks

Even with the normal editing power of SharePoint Designer, sometimes things aren't as easy or straightforward as you might like. This section provides a few suggestions or workarounds to help you get the most out of the CEWP.

13.5.1. Keep It Simple

For self-contained Projects, you may want to keep the script in its own file. If the functionality you are implementing does not depend on the fact that you are running in SharePoint, coding around the overhead of a Web Part page can be a pain. In these instances, you may find yourself better off taking advantage of the capability to define an external source file for the CEWP.

13.5.2. Use the Script Editor

SharePoint Designer's design surface does not have the capability to execute a script in real time. The default method for testing a script is to save the page and preview it in the browser. For complicated scripts, this can be a very inefficient debugging workflow.

The SharePoint Designer Script Editor allows you to run your scripts in the browser without first saving them to your SharePoint site. You can toggle back and forth between the Script Editor and the main SPD environment, and changes you make in one are automatically reflected in the other.

13.5.3. Create a Shell Page

SharePoint Designer does a great job of rendering previews of the information contained in Web Parts. When you are creating script to interact with SharePoint Page objects, however, sometimes you need to test with the real thing. ...

Get Professional Microsoft® SharePoint® Designer 2007 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.