Passing custom values from share point web part to a silverlight applications

634 views

Published on

During development of a Web Part, sometimes we have to use Custom Values to set properties to be used within the Web Part during execution. To pass the value of a custom property to a Silverlight Application – so that the value can be used in the logic implemented within Silverlight app is one of the scenarios involved while handling Custom Properties.

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
634
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Passing custom values from share point web part to a silverlight applications

  1. 1. Passing Custom Values from SharePoint Web Part to a Silverlight Applications During development of a Web Part, sometimes we have to use Custom Values to set properties to be used within the Web Part during execution. To pass the value of a custom property to a Silverlight Application – so that the value can be used in the logic implemented within Silverlight app is one of the scenarios involved while handling Custom Properties. To achieve the passing of Custom Value from Web Part to Silverlight Application we have to follow the steps below 1. Assign the value to be passed to CustomInitParameters property of Microsoft. SharePoint.WebPartPages.SilverlightWebPart. While assigning the we should concatenate a KEY (with which the value can be retrieved) as prefix to the value (for example <keystring>=<value> ). 2. The above mentioned assignment can be done in the overridden method CreateChildControls() of Web Part class. 3. In Silverlight application modify the constructor of MainPage class to take a parameter of type IDictionary. 4. Modify the Application_Startup() method in App.xaml.cs to call the new constructor of MainPage and pass StartupEventAgrs.InitParams as the argument. 5. Now implement the logic to get the custom value using ContainsKey(<keystring>) method from the IDictionary variable.Visit IVESIA’S WEBSITE Follow us at LINKEDIN and TWITTER

×