asp.net中的updatepanel和timer控件 [英] updatepanel and timer controls in asp.net

查看:128
本文介绍了asp.net中的updatepanel和timer控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个包含许多部门的网络表单。每个部门都有一些或其他asp控件。这些部门放在个人更新面板内。



那些有按钮的人没有任何计时器。



而显示静态数据的那些具有间隔属性的定时器控件。



每当我点击更新面板内的按钮时,所有其他更新面板也会获得更新。



有人能解释一下为什么会这样吗?

i have made a web form with many divisions. Each division has some or the other asp control. These divisions are placed inside individual update panels.

those which have buttons in it do not have any timer.

while those which show static data have timer controls in them with interval property.

Whenever i click a button inside a update panel , all other update panels also get updated.

Can anyone explain me why this is happening?

推荐答案

try this










<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
       <ContentTemplate>
// here, your button control 
       </ContentTemplate>
       <Triggers >
       <asp:AsyncPostBackTrigger ControlID="button" />
       </Triggers>
       </asp:UpdatePanel>







确保updatemode是conditonal,如果它总是刷新整个页面,如果它有条件更新特定的地方



并且按钮应该在contenttemplate里面




make sure updatemode is conditonal ,if it is always its refresh the whole page,if its conditional its update the the particular place

and the button should be inside the contenttemplate


这篇关于asp.net中的updatepanel和timer控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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