ラベルに時間を表示したい。それが正常に動作します分を表示することができない分タイマー
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Timer ID="Timer1" runat="server" Interval="3000" OnTick="Timer1_Tick">
</asp:Timer>
<asp:Label ID="Label1" runat="server" Text="Remaining Time:(Sec)"></asp:Label>
<asp:Label ID="Label2" runat="server" Text="100"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
</div>
と
protected void Timer1_Tick(object sender, EventArgs e)
{
Label2.Text = Convert.ToString((Convert.ToInt32(Label2.Text) - 1));
if (Convert.ToInt32(Label2.Text) == 0)
Response.Redirect("~/Default2.aspx");
}
ページaspx
に、しかし、私は代わりに第二の分を表示したい:私のコードです。これを行う方法はありますか?ありがとう。
分、これは私のコードに含める=秒/ 60 – Matthias
@matthiasを試してみてください。 –