ASP.net中的多个更新面板 [英] multiple update panel in ASP.net

查看:87
本文介绍了ASP.net中的多个更新面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在asp.net中使用多个更新面板,其中一个更新面板的内容在计时器刻度上更新,而其他更新面板应在按钮上单击.
但是问题在于,两个更新面板都在计时器刻度上更新了那里的内容,我不希望这样做.

请帮助我隔离两个更新面板内容的更新.

[OP的答案移至问题]

I want to use multiple update panel in asp.net, where one update panel''s content is updated on Timer tick while other update panel should be on button click.
But the problem is that , both update panels updates there content on timer tick, which I don''t want.

Please help me to isolate both update panels contents updation.

[OP''s answer moved to question]

<asp:UpdatePanel ID="UpdatePanel2" runat="server">
 
                <div ID="headerDiv">
 
                        Show
                  </div>
 
            <asp:LinkButton ID="lBtn_Updates" runat="server" BackColor="#CC0000"
                    CausesValidation="False" Font-Underline="False" ForeColor="White"
                    onclick="lBtn_Updates_Click">
 
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btn_search" EventName="Click"/>
            </Triggers>
 

here is the code..
 
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
 
                <div ID="headerDiv">
 
                        Show
                  </div>
                <asp:Timer ID="Timer1" runat="server" Interval="1000" ontick="Timer1_Tick">
 
            <asp:LinkButton ID="lBtn_Updates" runat="server" BackColor="#CC0000"
                    CausesValidation="False" Font-Underline="False" ForeColor="White"
                    onclick="lBtn_Updates_Click">
 
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick"/>
            </Triggers>

推荐答案

在更新面板中使用异步PostBack触发器.当计时器打勾时,然后更新面板.在其他更新面板中,使用异步回发"触发器.如果您可以共享代码,那么它就很容易解决.
use Asynchronous PostBack trigger within update panel. when timer tick then update the panel. In other update panel use Asynchronous PostBack trigger. if u can share code then it''s bit easy to solve.


带两个更新面板

现在,假设将在buttonclick上更新的updatepanel命名为buttonupdatepanel.
第二个将在timerclick上更新的updatepanel被命名为timerupdatepanel.

对于buttonupdatepanel,请在updatepanel中使用button1

对于timerupdatepanel,请单击timetick事件,然后编写
Take two update panel

Now suppose updatepanel which will be updated on buttonclick is named as buttonupdatepanel.
and second updatepanel which will be updated on timerclick is named as timerupdatepanel.

For buttonupdatepanel take button1 in updatepanel

for timerupdatepanel click on timetick event and then write
timerupdatepanel.updatepanel();





您的面板将在每个间隔进行更新.





Your panel will be updated at each intervals.


这篇关于ASP.net中的多个更新面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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