1

TabPanel にオンライン ユーザーを表示する Web ページに取り組んでおり、X 秒ごとに更新したいと考えています。この部分は機能します。ただし、TabContainer 内の他のすべてのタブも更新されますが、これは望ましくありません。オンラインユーザータブのコードは次のとおりです

<cc1:TabPanel runat="server" HeaderText="Online Users" ID="TabPanel1">

    <ContentTemplate>        
        <div>
            <div style="position:relative; text-align:left; width:650px; top: 0px; left: 0px;">
                <asp:Label ID="lblUpdate" runat="server" Text="This page refreshed automatically every 10 seconds, or press the update button to the right"></asp:Label>
            </div>
        </div>

        <asp:Timer runat="server" ID="timer1" Interval="10000"></asp:Timer>
        <asp:Timer runat="server" ID="timer2" Interval="9000"></asp:Timer>

        <asp:UpdatePanel runat="server" ID="updateOnlineUsers" UpdateMode="Conditional">

             <Triggers>
                <asp:AsyncPostBackTrigger ControlID="timer1" />
                <asp:AsyncPostBackTrigger ControlID="timer2"  />
            </Triggers>

            <ContentTemplate>  
                <div style="text-align:right; position:relative; top:-20px">
                    <asp:Image style="position:relative; display:none; z-index:1" ID="Image1" runat="server" ImageUrl="../images/reload.gif" />
                    <asp:ImageButton ID="ImageButton1" style="position:relative; z-index:2" runat="server" ImageUrl="../images/reload5.png" />  
                </div>                
                <div>                    
                    <asp:Label ID="lbluserCount" runat="server"></asp:Label>
                </div>
                <div>
                    <asp:Label ID="lblOfflineUsers" runat="server"></asp:Label>
                </div>
                <div>
                    <asp:Label runat="server" ID="lblOnlineUsers">Hi Everybody</asp:Label>
                </div>                    
            </ContentTemplate>
        </asp:UpdatePanel>    
    </ContentTemplate>
    </cc1:TabPanel>

前もって感謝します!

4

1 に答える 1

0

タイマーを TabPanel の外に移動します。その後、タイマーを AsyncPostbackTriggers として手動でコード ビハインドから登録する必要がある場合があります。

于 2013-08-23T18:59:05.960 に答える