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


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,


Thank you, this works perfect!


if you are using a separate js file for your logic you need to use this:
"var hv = $('input[id$=hidClientField]').val();" - otherwise javascript will throw a syntax error


I need to to thank you for your time due to this fantastic read!! I definitely enjoyed every bit of it and I have you bookmarked to see new information on your blog.
Java Training in Bangalore
Ui Development Training in Bangalore


Post a Comment