本文介绍了更新面板回发触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!
我可以使用带有异步回发触发器的更新面板,但是具有他的代码的页面无法正常工作..我在此页面中具有滚动条..n每当我向下滚动时,它都会自动向上滚动...我该如何解决这个问题问题

hi!
i ma using update panel with asynchronous post back trigger but the page which is having his code doesnot work properly..i have scroll bar in this page..n when ever i scroll down it automatically scrolls up...how could i resolve this problem

<pre lang="xml"><asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"><br />
                                                   <ContentTemplate><br />
                                                       <div id="ChatContent" runat="server" style="height: 355px; vertical-align: top; overflow-y: auto;<br />
                                                           text-align: left; margin-left: 10px; width: 97%;"><br />
                                                       </div><br />
                                                   </ContentTemplate><br />
                                                   <Triggers><br />
                                                       <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /><br />
                                                   </Triggers><br />
                                               </asp:UpdatePanel><br />
                                               <asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick"><br />
                                               </asp:Timer></pre><br />

推荐答案

<script type="text/javascript">
    var xPos, yPos;
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_beginRequest(BeginRequestHandler);
    prm.add_endRequest(EndRequestHandler);
    function BeginRequestHandler(sender, args) {
        xPos =




这篇关于更新面板回发触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 21:32