skip to Main Content

Embedding Sandbox Web Parts into Page Layouts and Master Pages

Note – this is applicable to both SharePoint 2010 and SharePoint 2013 … and despite rumours of “The Sandbox is deprecated” many features in SharePoint 2013 rely on the Sandbox so I don’t see it going anywhere for the time being.

This is something that I have been told many times, it is not possible to embed a server control developed in the Sandbox onto a Page Layout or Master Page because you can’t add the appropriate Tag Prefix to the header.

If you consider the standard way of doing this for a Farm / Full Trust solution:

Powerpivot Clip Image002

In the sandbox we obviously can’t reference the Assembly in the same way because (a) it isn’t deployed to the GAC / BIN folders and (b) it runs in a completely different process so won’t be JIT compiled by the .Net Framework… but there is a solution!

Microsoft.SharePoint.WebPartPages.SPUserCodeWebPart allows you to embed a Web Part from an assembly running in the Sandbox.

Powerpivot Clip Image004

You still need the “AssemblyFullName” attribute. I’ve found the easy way to get this is to add a feature receiver to a Feature in Visual Studio then copy-paste it from the Manifest in Visual Studio (which contains the full text that you need).

So that’s it! Happy coding!

By Martin Hatch, Associate Principal SharePoint Consultant
www.martinhatch.com

Have a comment? Let us know below, or send an email to [email protected]

About the Author

BC Technical Team

Our technical team contribute with blogs from their respective specialities, be that Azure, SQL, BizTalk, SharePoint, Xamarin and more. From the lead architect to developers and testers, each person provides content straight from their experience.

Our Technologies

HAVE YOU SEEN OUR NEWSLETTER?

ABOUT US

Ballard Chalmers is one of the UK’s leading software development companies, specialising in engineering enterprise applications on the Microsoft Platform. We are principally dedicated to custom software development and integration for the Microsoft Cloud, as well as on-premises and hybrid systems. Our expertise is in Microsoft .NET and Azure, SQL Server, BizTalk Server, SharePoint Server and Xamarin.

01342 410223

[email protected]

 

CONTACT US






This form collects your name and details so that we may answer you. Check out our Privacy Policy for full details on how we protect and manage your data.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

© 2020 Ballard Chalmers Ltd. All Rights Reserved

Back To Top