asp.net中的updatepanel和timer控件

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