1
votes

I wanna create Contextual Tab using Webpart In Sandbox Solution..that time I am getting Error as below When i am added Custom-Webpart :

Web Part Error: Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred.

In My Webpart's Code

Microsoft.SharePoint.WebControls.SPRibbon.GetCurrent(this.Page).MakeTabAvailable("MyProject.Ribbon.HelloTab"); 

Is there another way to Solution To create Custom Ribbon Tab?

1

1 Answers

0
votes

Altering the ribbon is not permitted from within the sandbox. You have to options available to you.

  1. Make your solution a farm solution (thereby giving it the necessary permissions)
  2. Use a sandbox proxy the perform the steps on the ribbon (see MSDN)