Thursday 22 March 2012

How to use a webpart property in Ecmascript or Javascript client object model in SharePoint 2010


Here is a short tip about how to use a webpart property in your Ecmascript or Javascript client object model in your sandbox or visual webpart.

If you need a tip about how to create a custom editorpart toolpart see my Post Create custom EditorPart for Sandbox webpart - SharePoint 2010. So while working with this in my sandbox webpart i had a requirenment to consume the webpart property from my custom editorpart in Javascript client object model.

So here is how you do it -
If your webpart property is for getting a list name below is how you use it in your ecmascript.

var ListName = '<%=taskList%>';

tada!

Ads by Google

No comments:

Post a Comment