1

I build a visual web part in asp.net and I'm trying to embed a xap over it so that users who don't have Silverlight installed would see the asp content:

<object id="SilverlightPlugin1" width="300" height="400" data="data:application/x-silverlight-2," type="application/x-silverlight-2" > <param name="source" value="/content/SilverlightApplication1.xap"/> />

It all seems to work except the silverlight app doesn't seem to like that way of being embedded - the Chrome console gives the following error:

Uncaught Error: Unhandled Error in Silverlight Application Value cannot be null. Parameter name: webFullUrl at Microsoft.SharePoint.Client.ClientRuntimeContext..ctor(String webFullUrl) at Microsoft.SharePoint.Client.ClientContext..ctor(String webFullUrl) at SilverlightApplication1.MainPage.GetItemFromSharePointList() at SilverlightApplication1.MainPage..ctor() at SilverlightApplication1.App.Application_Startup(Object sender, StartupEventArgs e) at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)

I suspect it has something to do with me using ClientContext context = new ClientContext(ApplicationContext.Current.Url); in the silverlight code. Please give me some hints.

1 Answer 1

1

Got it, had to provide the context in the init params of my object tag.

<object id="SilverlightPlugin1" width="400" height="300" data="data:application/x-silverlight-2," type="application/x-silverlight-2" > <param name="source" value="/content/SilverlightApplication1.xap"/> <param name="initParams" value="MS.SP.url=<%= SPContext.Current.Web.Url %>"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.