页面有两个UpdatePanel,现在需要实现第一个UpdatePanel中的是每秒钟刷新,第二个是每30秒刷新。, 在两个UpdatePanel外面还有一个 <asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>控件。。现在碰到的问题是,第二个UpdatePanel不起作用。也跟着第一个一样是每秒刷新。前台相关代码如下:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table style="width: 80%; border: 0px solid #DCDCDC; margin: 0 auto;">
<tr>
<td rowspan="2" style="width: 10px;">
</td>
<td rowspan="2" valign=bottom align=center>
<asp:Panel ID="on" runat="server">
<div id="n" style="margin-right: 0; padding: 0px; width: 305px;">
<img src="../../Manager/Image/nocount.png" alt="现在不是竞价时间哦!" /></div>
</asp:Panel>
<asp:Panel ID="outtime" runat="server">
<div id="T" style=" margin-right: 0px; padding: 0px; width: 345px; visibility: visible">
<span style="color: Red; font-size: 15px;">竞拍剩余时间:</span>
<%--<span class="red"><asp:Literal ID="endDay" runat="server"></asp:Literal></span><span>
天 </span> --%>
<span class="red">
<asp:Literal ID="endHour" runat="server"></asp:Literal>
</span><span style="color:Yellow">时 </span><span class="red">
<asp:Literal ID="endminute" runat="server"></asp:Literal></span> <span style="color:Yellow">分 </span>
<span class="red">
<asp:Literal ID="endsecond" runat="server"></asp:Literal></span><span style="color:Yellow">秒</span>
</div>
</asp:Panel>
</td>
<td class="h2_title" style="color:Red ">
一、物品信息
</td>
</tr>
<tr>
<td style="width: 60%;">
<table cellspacing="0" rules="all" border="1px #E0DFE3 solid" style="width: 100%;
border-collapse: collapse;">
<tr style="border: 1px solid #CCCCCC; height:22px ">
<th style="width: 20%; color:Red; border: 1px solid #CCCCCC; " align="center" scope="col">
竞拍物品
</th>
<th style="width: 19%; color:Red; border: 1px solid #CCCCCC; " align="center" scope="col">
起拍价
</th>
<th style="width: 18%; color:Red; border: 1px solid #CCCCCC; " align="center" scope="col">
成交价
</th>
<th style="width: 18%; display:none; color:Red; border: 1px solid #CCCCCC; " align="center" scope="col">
成交数
</th>
<th style="width: 25%; color:Red; border: 1px solid #CCCCCC; " align="center" scope="col">
交易时段
</th>
</tr>
<tr style="border: 1px solid #CCCCCC; height:22px ">
<th style="color:red;border: 1px solid #CCCCCC; ">
<asp:Label ID="lb1Nmae" ForeColor="#CCCCCC" runat="server"></asp:Label>
</th>
<th style="color:red;border: 1px solid #CCCCCC; ">
<asp:Label ID="lblStaringPrice" ForeColor="#CCCCCC" runat="server"></asp:Label>
</th>
<th style="color:red;border: 1px solid #CCCCCC; ">
<asp:Label ID="lblPrice" ForeColor="#CCCCCC" runat="server"></asp:Label>
</th>
<th style="color:red;border: 1px solid #CCCCCC; display:none;">
<asp:Label ID="lblNum" ForeColor="#CCCCCC" runat="server"></asp:Label>
</th>
<th style="color:red;border: 1px solid #CCCCCC; ">
<asp:Label ID="lblTime" ForeColor="#CCCCCC" runat="server"></asp:Label>
</th>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table align="center" style="width: 80%; margin: 0 auto; color:Red;">
<asp:Timer ID="Timer1" Interval="1000" runat="server" OnTick="Timer1_Tick">
</asp:Timer>
<tr>
<td class="h2_title" style="color:Red" align="center" >
二、竞拍信息
</td>
</tr>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate> <div class="blk_02" id="chg">
<div class="table_title">
<table width="80%" cellspacing="0">
<tbody>
<tr>
<th width="10%" >
序号
</th>
<th width="20%">
价格
</th>
<th width="20%">
数量
</th>
<th width="20%">
金额
</th>
<th width="30%" align="center">
时间
</th>
</tr>
</tbody>
</table>
</div>
<div class="table_data" id="demo">
<div id="demo1" runat="server" style=" padding:0px"> <asp:Repeater runat=server ID="gv">
<HeaderTemplate>
<table cellspacing="0" rules="all" border="1" width="80%" >
</HeaderTemplate>
<ItemTemplate>
<tr align="center" >
<td width="10%" style=" color:#CCCCCC" >
<%#Container.ItemIndex+1%>
</td>
<td align="center" width="20%" style=" color:#CCCCCC">
<%#Eval("Price")%>
</td>
<td width="20%" style=" color:#CCCCCC">
<%#Eval("SubmitNum")%>
</td>
<td width="20%" style=" color:#CCCCCC">
<%#Eval("Bail")%>
</td>
<td width="30%" style=" color:#CCCCCC">
<%#Eval("CreateTime")%>
</td> </tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
</div>
</div>
<asp:Timer ID="Timer2" Interval="10000" runat="server" OnTick="Timer2_Tick">
</asp:Timer>
</ContentTemplate>
</asp:UpdatePanel>后台相关代码:
protected void Timer1_Tick(object sender, EventArgs e)
{
}
protected void Timer2_Tick(object sender, EventArgs e)
{
}
//页面倒计时的方法
protected void IsVisible()
{
Timer2.Enabled = true;
Timer2.Interval = 30000;
Timer1.Interval = 1000;
Timer1.Enabled = true;
</asp:ScriptManager>控件。。现在碰到的问题是,第二个UpdatePanel不起作用。也跟着第一个一样是每秒刷新。前台相关代码如下:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table style="width: 80%; border: 0px solid #DCDCDC; margin: 0 auto;">
<tr>
<td rowspan="2" style="width: 10px;">
</td>
<td rowspan="2" valign=bottom align=center>
<asp:Panel ID="on" runat="server">
<div id="n" style="margin-right: 0; padding: 0px; width: 305px;">
<img src="../../Manager/Image/nocount.png" alt="现在不是竞价时间哦!" /></div>
</asp:Panel>
<asp:Panel ID="outtime" runat="server">
<div id="T" style=" margin-right: 0px; padding: 0px; width: 345px; visibility: visible">
<span style="color: Red; font-size: 15px;">竞拍剩余时间:</span>
<%--<span class="red"><asp:Literal ID="endDay" runat="server"></asp:Literal></span><span>
天 </span> --%>
<span class="red">
<asp:Literal ID="endHour" runat="server"></asp:Literal>
</span><span style="color:Yellow">时 </span><span class="red">
<asp:Literal ID="endminute" runat="server"></asp:Literal></span> <span style="color:Yellow">分 </span>
<span class="red">
<asp:Literal ID="endsecond" runat="server"></asp:Literal></span><span style="color:Yellow">秒</span>
</div>
</asp:Panel>
</td>
<td class="h2_title" style="color:Red ">
一、物品信息
</td>
</tr>
<tr>
<td style="width: 60%;">
<table cellspacing="0" rules="all" border="1px #E0DFE3 solid" style="width: 100%;
border-collapse: collapse;">
<tr style="border: 1px solid #CCCCCC; height:22px ">
<th style="width: 20%; color:Red; border: 1px solid #CCCCCC; " align="center" scope="col">
竞拍物品
</th>
<th style="width: 19%; color:Red; border: 1px solid #CCCCCC; " align="center" scope="col">
起拍价
</th>
<th style="width: 18%; color:Red; border: 1px solid #CCCCCC; " align="center" scope="col">
成交价
</th>
<th style="width: 18%; display:none; color:Red; border: 1px solid #CCCCCC; " align="center" scope="col">
成交数
</th>
<th style="width: 25%; color:Red; border: 1px solid #CCCCCC; " align="center" scope="col">
交易时段
</th>
</tr>
<tr style="border: 1px solid #CCCCCC; height:22px ">
<th style="color:red;border: 1px solid #CCCCCC; ">
<asp:Label ID="lb1Nmae" ForeColor="#CCCCCC" runat="server"></asp:Label>
</th>
<th style="color:red;border: 1px solid #CCCCCC; ">
<asp:Label ID="lblStaringPrice" ForeColor="#CCCCCC" runat="server"></asp:Label>
</th>
<th style="color:red;border: 1px solid #CCCCCC; ">
<asp:Label ID="lblPrice" ForeColor="#CCCCCC" runat="server"></asp:Label>
</th>
<th style="color:red;border: 1px solid #CCCCCC; display:none;">
<asp:Label ID="lblNum" ForeColor="#CCCCCC" runat="server"></asp:Label>
</th>
<th style="color:red;border: 1px solid #CCCCCC; ">
<asp:Label ID="lblTime" ForeColor="#CCCCCC" runat="server"></asp:Label>
</th>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table align="center" style="width: 80%; margin: 0 auto; color:Red;">
<asp:Timer ID="Timer1" Interval="1000" runat="server" OnTick="Timer1_Tick">
</asp:Timer>
<tr>
<td class="h2_title" style="color:Red" align="center" >
二、竞拍信息
</td>
</tr>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate> <div class="blk_02" id="chg">
<div class="table_title">
<table width="80%" cellspacing="0">
<tbody>
<tr>
<th width="10%" >
序号
</th>
<th width="20%">
价格
</th>
<th width="20%">
数量
</th>
<th width="20%">
金额
</th>
<th width="30%" align="center">
时间
</th>
</tr>
</tbody>
</table>
</div>
<div class="table_data" id="demo">
<div id="demo1" runat="server" style=" padding:0px"> <asp:Repeater runat=server ID="gv">
<HeaderTemplate>
<table cellspacing="0" rules="all" border="1" width="80%" >
</HeaderTemplate>
<ItemTemplate>
<tr align="center" >
<td width="10%" style=" color:#CCCCCC" >
<%#Container.ItemIndex+1%>
</td>
<td align="center" width="20%" style=" color:#CCCCCC">
<%#Eval("Price")%>
</td>
<td width="20%" style=" color:#CCCCCC">
<%#Eval("SubmitNum")%>
</td>
<td width="20%" style=" color:#CCCCCC">
<%#Eval("Bail")%>
</td>
<td width="30%" style=" color:#CCCCCC">
<%#Eval("CreateTime")%>
</td> </tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
</div>
</div>
<asp:Timer ID="Timer2" Interval="10000" runat="server" OnTick="Timer2_Tick">
</asp:Timer>
</ContentTemplate>
</asp:UpdatePanel>后台相关代码:
protected void Timer1_Tick(object sender, EventArgs e)
{
}
protected void Timer2_Tick(object sender, EventArgs e)
{
}
//页面倒计时的方法
protected void IsVisible()
{
Timer2.Enabled = true;
Timer2.Interval = 30000;
Timer1.Interval = 1000;
Timer1.Enabled = true;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货