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
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
Thank you, this works perfect!
ReplyDelete