でタイマーを使用する場合:これは私のdiv要素で更新する前にクラスの競合私は、このコードとしてupdatePanalを使用して<code>asp.net</code>アプリケーションを構築しようとしているupdatePanal
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:Timer runat="server" id="Timer1" Interval="10000" OnTick="Timer1_Tick"></asp:Timer>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
<ContentTemplate>
<div class="col-xs-6 col-md-3">
<div class="panel panel-default">
<div class="panel-body easypiechart-panel">
<h4>Humidity </h4>
<div class="easypiechart" id="easypiechart-blue" data-percent="4" ><span class="percent">92%</span>
</div>
<button class="btn btn-primary">Adjust Humidity</button><br /><br /><br />
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
! :
これが起こる理由:それは、この変身更新後
?
ちょうどボタン、 'ClientScript.RegisterStartupScript(this.GetType()、 "updateProgress"、 "updateProgress(" "+ 100 +"'); ")で何時でも試してみました。 ' でも同じエラーです! –
私はちょうど同様のパイチャートでテストしたところ、コードは機能しています。パイはUpdatePanel内でタイマーの更新やボタンのクリック後に再構築されます。あなたの質問にパイを構築するjavascriptコードを追加できますか? – VDWWD
私はこの関数を使用しますupdateProgress(percentage){ document.getElementById( 'easypiechart-blue')。setAttribute( "data-percent"、percentage);document.getElementById( 'precentH')。innerText =パーセント+ "%"; } updatepanlなしでも動作しますが、使用するとうまくいきませんでした。 –