Passing value from code-behind to Javascript

后端 未结 5 896
粉色の甜心
粉色の甜心 2021-01-19 03:59

I am using a jQueryUI ProgressBar to show users how much allowed file storage they have used. The percentage is calculated in code-behind and should be passed to Javascript.

5条回答
  •  广开言路
    2021-01-19 04:26

    .net will modify the id you give a control to ensure it is unique, so you are not accessing it with the correct id. If you give the hidden field a unique class name, you can access the value that way:

     
    var pct = $('.hiddenClass').val();
    

提交回复
热议问题