Hi dudes,
I am new to this Silverlight 2.0 and i actually trying to deploy the silverlight as webpart in sharepoint 2007.
Installations i have done 1. VS 2008 with SP1 2. Silverlight 2.0 SDK and exe 3. Silverlight Tools for VS 2008 4. MOSS 2007
I have created the sample silverlight application and got the xap file from the bin directory of the solution.
Then i wrote a standard sharepoint webpart with reference to bothe Web.Extnesions and Microsoft.Silverlight dll's... here the code goes
using System; using System.Runtime.InteropServices; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Serialization; using System.Web.UI.SilverlightControls; using Microsoft.SharePoint; using Microsoft.SharePoint.WebControls; using Microsoft.SharePoint.WebPartPages;
namespace SLWeb_Part1 { [Guid("c890f832-05d2-4724-ae25-5f34c827c6c2")] public class SLWeb_Part1 : System.Web.UI.WebControls.WebParts.WebPart { public SLWeb_Part1() { }
[WebBrowsable(true),
Personalizable(PersonalizationScope.User),
WebDescription("Location of the Silverlight XAP package"),
WebDisplayName("XAP Location")]
public string XAPSource { get; set; }
[WebBrowsable(true),
Personalizable(PersonalizationScope.User),
WebDescription("Silverlight Controld ID "),
WebDisplayName("Control ID")]
public string ControlID { get; set; }
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
if (scriptManager == null)
{
scriptManager = new ScriptManager();
this.Controls.Add(scriptManager);
}
}
protected override void CreateChildControls()
{
base.CreateChildControls();
Silverlight sl = new Silverlight();
sl.Source = XAPSource;
sl.ID = ControlID;
sl.Width = new Unit(400);
sl.Height = new Unit(400);
this.Controls.Add(sl);
}
}
deployed the same to the sharepoint site also, then i made an entry to the sharepoint site's web.config file to include the Silverlight and Web.Extension assembly's like
then included application/x-silverlight-app as MIME type for the web application in IIS...
after doing all this... i was able to browse the site as usual, but i couldnt see the SilverLight Component running.... and it is not throwing any error also...
can anybody help me to solve this problem at the earliest, do i miss any step in this configuration???
Thanks in advance Karthick