SharePoint 2013 - Read web part properties with client side JavaScript.

Hello,

Sometimes we want to be able to read web part properties on our client side code, e.g. when we want to use jQuery functionality to implement certain requirements.

Easiest way to achieve this is just use the asp:HiddenField control to store the value of the property, then get the value using jQuery.

So on your html:

Then on the JavaScript section:


On your ascx code behind file, just store the value during page load:

Hope this helps,
Andreas

Comments

Post a Comment

Popular posts from this blog

SharePoint 2013 anonymous access add attachments to list item

CRM Plugin - Parent and Child Pipeline

Sitecore custom publish agent from specific node and at a specific time