public
Last active

SharePoint 2010 Sandbox Code

  • Download Gist
ULS Log Entries
1 2 3 4 5
 
01:25:18.94 SPUCHostService.exe (0x0A8C) 0x0D58 SharePoint Foundation Sandboxed Code Service fe8a Medium - - Unable to activate worker process proxy object within the worker process: ipc://fe3bdb40-dbc3-4322-b772-b34a5752336c:7000
01:25:18.94 SPUCHostService.exe (0x0A8C) 0x0D58 SharePoint Foundation Sandboxed Code Service fe8c Medium - - Error activating the worker process manager instance within the worker process. - Inner Exception: System.InvalidOperationException: Unable to activate worker process proxy object within the worker process: ipc://fe3bdb40-dbc3-4322-b772-b34a5752336c:7000 at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.CreateWorkerProcessProxies()
01:25:18.94 SPUCHostService.exe (0x0A8C) 0x0D58 SharePoint Foundation Sandboxed Code Service ei0t Medium - Process creation/initialization threw an exception. Stopping this process. "ipc://fe3bdb40-dbc3-4322-b772-b34a5752336c:7000"
01:25:19.05 SPUCHostService.exe (0x0A8C) 0x0D58 SharePoint Foundation Sandboxed Code Service fe87 Medium - - Error activating the worker process manager instance within the worker process. - Starting worker process threw - Inner Exception: System.InvalidOperationException: Unable to activate worker process proxy object within the worker process: ipc://fe3bdb40-dbc3-4322-b772-b34a5752336c:7000 at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.CreateWorkerProcessProxies()
WebPart Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
 
namespace _005_SandBoxWebpart.WP_HelloWorld
{
[ToolboxItemAttribute(false)]
public class WP_HelloWorld : WebPart
{
Label lblName = new Label() { ID = "lblName", Visible = true, Text = "You Name Plese: " };
Button brtnSayHello = new Button() { ID = "btnSayHello", Visible = true, Text = "Greet" };
TextBox txtName = new TextBox() { ID = "txtName", Visible = true, };
 
protected override void CreateChildControls()
{
 
brtnSayHello.Click += new EventHandler(brtnSayHello_Click);
 
Controls.Add(lblName);
Controls.Add(txtName);
Controls.Add(brtnSayHello);
}
 
void brtnSayHello_Click(object sender, EventArgs e)
{
string JSScript = "alert('Hi {0}, greetings from sandboxed webpart.');";
 
JSScript = string.Format(JSScript,txtName.Text);
ScriptManager.RegisterStartupScript(this, this.GetType(), "HelloWorldScript", JSScript, true);
}
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.