Passing value from code-behind to Javascript

后端 未结 5 893
粉色の甜心
粉色の甜心 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:29

    You need to get the rendered id of your hidden input

    var pct = document.getElementById("<%=filesPercentage.ClientID%>").value;
    

    and from the moment that you run the input on server its better to use the asp:HiddenField and not the input

提交回复
热议问题