在asp.net浏览器中使用计时器控件时,滚动向上移动 [英] When using timer control in asp.net browser scroll moved upwards

查看:97
本文介绍了在asp.net浏览器中使用计时器控件时,滚动向上移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好先生,



我在asp.net网站上使用计时器控制,以小时,分钟和秒显示左侧考试时间

但问题是当我向下滚动页面因为计时器滚动向上移动时每个计时器打勾



以下是asp.net代码片段...



Hello Sir,

I am using timer Control in asp.net website which shows left exam time in Hour ,Minute and seconds
but the problem is when i m scrolling page downwards because of timer scroll moved upwards with each timer tick

below is the asp.net code snippet...

<asp:UpdatePanel ID="UpdatePanel1" runat="server"  >
          <Triggers>
    <asp:AsyncPostBackTrigger ControlID="Timer1"  />
  </Triggers>
          <ContentTemplate>
          <table cellpadding="0" cellspacing="0">
          <tr>
          <td> <b>Time Left :</b> </td>
          <td>
          <asp:Timer ID="Timer1" runat="server">
        </asp:Timer>
               <asp:Label ID="hourLabel" runat="server" Font-Bold="True" Font-Size="Medium"

               ForeColor="#CC0000" Text="00"></asp:Label>
              :<asp:Label ID="minuteLabel" runat="server" Font-Bold="True" Font-Size="Medium"

           ForeColor="#CC0000" Text="0"></asp:Label>
              :<asp:Label ID="timerLabel" runat="server" Font-Bold="True" Font-Italic="False"

           Font-Size="Medium" ForeColor="#CC0000"></asp:Label>

          </td>
          </tr>
          </table>
            </ContentTemplate>

        </asp:UpdatePanel>



请帮我解释为什么会发生这种情况。

我在2天内严重陷入这个问题


please help me why it is happening.
I am badly stuck in this problem since 2 days

推荐答案

你可能想在页面指令上尝试MaintainScrollPositionOnPostback =true以保持页面的滚动位置。



您可以从MSDN中读取更多信息链接? [ ^ ]。



祝你好运,

OI
You might want to try MaintainScrollPositionOnPostback="true" on your page directive to keep the scroll position of the page.

You can read more from MSDN link[^].

Good luck,
OI


这篇关于在asp.net浏览器中使用计时器控件时,滚动向上移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆