Silverlight Not showing in Sharepoint

Jun 10, 2009 at 10:05 PM

Hello All,

  I am newbie to both Silverlight and sharepoint so forgive any dumb questions.


I have a silver light app (very basic) and I have the .xap file copied to the virtualdirectories/80/ClientBin directory.    After that I have created a webpart using WSPBuilder  posted below is the OnLoad and the CreateChildControls methods.  The string to the .xap I have tried several ways from sunday and cannot get the silverlight app to show up.  The webpart deploys, don't see any errors. I do get a error in the status bar but all it says is line xxx and "object expected".. Like a javascript error...    Any thoughts or help would be greatly appreciated....

        protected override void OnLoad(EventArgs e)

            ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
            if (scriptManager == null)
                scriptManager = new ScriptManager();
                Controls.AddAt(0, scriptManager);


        protected override void CreateChildControls()
            silverlightControl = new Silverlight();
            silverlightControl.ID = SilverlightControlID;
            silverlightControl.Source = "~/ClientBin/slPhaseTypeBar.xap";




Oct 1, 2009 at 10:00 PM

A couple of things. 

1.  For me, I had to set the Height of the web part, otherwise the SL control didn't show up...It might be there, you just might not see it.

2.  The web.config file for the sharepoint server needs to have some settings in it.  If you don't have it already, get the book:  Sharepoint 2007 Development using Microsoft Silverlight 2 by Fox and Stubbs...It lays out in there exactly what needs to happen....

3. can just use a Content Editor web part and add the object tag html for the SL control...

Hope that helps.