How to pass values between SharePoint Web Part and Silverlight

No.of Views2828
Bookmarked0 times
Downloads 
Votes0
By  André Lage   On  10 Nov 2010 10:11:10
Tag : SharePoint , Development and Programming
This article try to explain how we can use SharePoint 2010 Web Part and pass values to Silverlight using code Behind and Visual studio and i will not enter on details on how we create WebPart Solution
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

This article try to explain how we can use SharePoint 2010 Web Part and pass values to Silverlight using code Behind and Visual studio and i will not enter on details on how we create WebPart Solution.

The first thing you will need create on your WebPart is the embeeded Object for the Silverlight. On the embeeded Object we need to define the following Parameters:

  • Source: The XAP file where will be our Silverlight Solution.
  • initparams: The values will pass from the webpart to our Silverlight solution. 
Image Loading

To support the WebPart i will create the support WebControl class call SilverlightPlugin to pass the Values and file ".XAP" parameter. 

Image Loading

To pass the values from the WebPart to Silverhligth we need to call the App.xaml file to access to Method “Application_Startup”. We call the values using InitParams and this values will pass to the MainPage Class like described in the image.

Image Loading

To pass the values to the Class MainPage the String values “param” and “url” have to be “public”. 

Image Loading

This values can be very usefull if you want to pass info and pre-load info from the current Site, will help users add the correct information. 

Image Loading


so this is Very easy .By default already exist “Silverlight web Part” and have a property to pass values from Web Part to Silverlight, this is a example on how the values are transfer between this 2 diferent products. 

Image Loading
Image Loading

Conclusion

This article try to explain how we can use SharePoint 2010 Web Part and pass values to Silverlight using code Behind and Visual studio .Hope you like this article.Have fun with SharePoint 2010.

 
Sign Up to vote for this article
 
About Author
 
André Lage
Occupation-Not Provided
Company-Not Provided
Member Type-Senior
Location-Portugal
Joined date-09 Jun 2010
Home Page-Not Provided
Blog Page-Not Provided
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top