SharePoint Designer 2010 Trick

 

Some of us remember the perils of removing files that SharePoint decided to ghost in the content database.  Well for those of you that find yourself needing to remove items that are ghosted in SharePoint 2010 there is good news.  SharePoint designer can do it for you in four easy steps

  1. Open the site in designer
  2. Click on the All Files item in the navigation area
  3. Find the file and check it out
  4. right click on the file and click delete

Playing in SharePoint 2010’s sandbox

 

As the SharePoint developers among us are probably aware, the newest version of SharePoint now has the sandbox mode for solutions.  I knew about this mode and that it put certain limitations on the code in a sandboxed project.  What I did not realize, was that in a sandboxed solution you cannot create connectable web parts nor can you call external services.  Well you can create connectable web parts and call external services but if you do you should expect them to fail.

I recently was on a project where I the client needed a connected web part that hosted a Silverlight Bing maps control.  This control would display the items that were sent in using the web part connection.  This enabled the client to connect the web part to a list view web part and as the list view was filtered, so were the items in the silver light Bing map.  The other requirement was that they wanted this web part to be in the new Sandbox solution.  Sounds pretty simple right?

Well the Silverlight map part was pretty easy after i came up with a way to pass in the connected data.  Even the connected web part was pretty easy.  There is nothing special there, I just followed the MSDN example and that worked like a charm. 

Then came a problem.  I changed the SharePoint project from un-sandboxed to sandboxed.  After that my web part would no longer accept connections.  There was no error or information message as to why this was the case.  The connections context menu was just grayed out and a tool tip message just informed me that the web part did not accept connections.  The web part also performed an initial geocode using the Bing geocoding service and that stopped working.  I would get a error when the web part tried to geocode with a somewhat cryptic error.  This error had to do with the code attempting to run the program csc.exe.  I couldn’t figure out why my web part was trying to call the compiler. 

So the moral of the story is, if you need to call external services or have connectable web parts don’t try to use a sandboxed solution.

var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(“%3Cscript src='” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));

try{
var pageTracker = _gat._getTracker(“UA-20994872-2”);
pageTracker._trackPageview();
} catch(err) {}

SharePoint Sessions Recap

At MIX10 there were 3 SharePoint sessions.  I went to each of the sessions and found all of them interesting. 

All session links below go to the MIX page for that session.  At the MIX page you can view the recorded session.

The session Designing an Internet-Facing Web Site Using SharePoint 2010 discussed branding, silverlight, and the features that enable SharePoint 2010 to support Internet sites.  Among these features is Lockdown mode helps protect internet sites from anonymous access.  It allows anonymous users to access SharePoint 2010 pages and sites but also protects pages in the _layouts virtual directory and the forms pages.  This session provided in depth code examples for branding, theming, and even the incorporation of Silverlight elements to make sites more interactive.

The session Building Rich and Interactive User Experiences in SharePoint described the elements of SharePoint 2007 and SharePoint 2010 that enable the features that are necessary for public internet sites.  Public internet sites need advanced branding and accessibility.  Some public sites need translations for other countries or target users.  This session focused mostly on describing techniques that could be used and did not cover actual code examples.

The final SharePoint session entitled Designing Corporate Web Sites using SharePoint 2010 described tools and techniques used to design sites in SharePoint.  This is an interesting session as it shows developers techniques and the tools that support them like SharePoint Designer, Expression Blend, and Visual Studio.  This session is a must for developers that want to build highly interactive sites in SharePoint.