Learn more about SQL Server tools

mssqltips logo
 

Tutorials          DBA          Dev          BI          Career          Categories          Webcasts          Whitepapers          Today's Tip          Join

Tutorials      DBA      Dev      BI      Categories      Webcasts

DBA    Dev    BI    Categories

 
Untangle TempDB Performance with SQL Diagnostic Manager - Free Webinar
 

How to Use the Silverlight SharePoint Web Part to Display Silverlight Applications


By:   |   Last Updated: 2011-04-05   |   Comments   |   Related Tips: > Sharepoint

Problem

Silverlight applications are used to build rich Internet-based applications. SharePoint previously allowed Silverlight integration with some configurations and many deployment dependencies.

Solution

SharePoint 2010 has introduced a new web part (Silverlight Web Part) which is an out of the box SharePoint web part. It facilitates one to view their Silverlight applications. The Silverlight web part always accepts the application in the ".xap" format, which is basically the compressed output file for the Silverlight application. In this article, we will show how to use out of box Silverlight web part in SharePoint 2010.

We have created a sample Silverlight application using Visual Studio 2010 which will change the content of the button after being pressed. For instance when the application is loaded for the first time, the button content would be "Press Me!!"

press me

When the button is pressed, the content would change to "UnPress Me!!". Again if it is pressed it would change to "Press Me!!". It is a very basic sample of a Silverlight application.

unpress me

As the Silverlight web part only accepts files in the .xap format, let's find one.

If the Silverlight application is created using Visual Studio 2010, one could find a .xap file in the projectfolder -> projectfolder.web -> ClientBin folder.

new folder

We need to upload the .xap file into one of the SharePoint libraries and we would prefer to upload in an asset library (i.e. the existing Site Assets Library). To upload the .xap file, go to the library and click "Add document".

site assets

Browse the source path of the "clientbin" folder and select the .xap file and click OK. One can select to overwrite the existing file in the library too.

upload document

To add a Silverlight web part, go to SiteActions -> Edit Page. Click "Add web part". In the "Media and Content" category, select "Silverlight web part" and click OK.

web parts

Open the tool pane. Under the application category, click on "configure" and select the application file source path as the document name (.xap files) that we uploaded in the library as displayed in the image below.

silverlight web part

Click "OK" and select "Stop editing" from the Page tab.

press me

The Silverlight application is viewable and accessible very easily without any kind of back-end configurations.

Next Steps
  • Use the Silverlight web part to build different, richer applications and integrate them with SharePoint.
  • Use Visual Studio 2010 to create custom Silverlight applications for building rich UI applications.


Last Updated: 2011-04-05


next webcast button


next tip button



About the author
MSSQLTips author Rahul Mehta Rahul Mehta is a Project Architect/Lead working at Tata Consultancy Services focusing on ECM.

View all my tips





Post a comment or let the author know this tip helped.

All comments are reviewed, so stay on subject or we may delete your comment. Note: your email address is not published. Required fields are marked with an asterisk (*).

*Name    *Email    Email me updates 


Signup for our newsletter
 I agree by submitting my data to receive communications, account updates and/or special offers about SQL Server from MSSQLTips and/or its Sponsors. I have read the privacy statement and understand I may unsubscribe at any time.



    



Learn more about SQL Server tools