將值傳遞給Javascript的問題,我是否在傳遞值時會出錯。將隱藏值傳遞給JavaScript中的JavaScript時出錯
var percentage= parseInt(document.getElementById("<%=hid_Percentage.ClientID%>").value);
var color = document.getElementById("<%=hid_Color.ClientID%>").value;
var progress1 = new RGraph.VProgress('progress1', percentage, 100);
progress1.Set('chart.colors', [color]);
progress1.Set('chart.tickmarks', false);
progress1.Draw();
我有2個隱藏字段
<asp:HiddenField ID="hid_Percentage" runat="server" />
<asp:HiddenField ID="hid_Color" runat="server" />
而且我這是怎麼傳遞價值的隱藏字段在後面的代碼中
double value = (read * 100/count);
string vProgressColor = "'#e01600'";
hid_Percentage.Value = Convert.ToString(value);
hid_Color.Value = vProgressColor;
爲百分比值傳遞asp.net正如使用該值繪製圖表一樣。但顏色是emply。它沒有得到顏色。,