如何避免页面刷新使用更新面板 [英] How to Avoid page refreshing Using update panel

查看:67
本文介绍了如何避免页面刷新使用更新面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了Masterpage。



在子页面中,我添加了 UpdatePanel 和<$的属性c $ c> UpdatePanel 和触发器也。



但子页面仍然刷新。



如何避免每个子页面中的页面刷新 PostBack



请帮帮我。



我需要非常紧急



< asp:contenetplaceholder id =mainrunat =server>

< asp:scriptmanager id =scriptmanager1runat = server>

< asp:updatepanel id =updatemainupdatemode =conditional>

< asp:content>

< asp:Dropdownlist id =ddlcityrunat =server>< asp:Dropdownlist>

< ; asp:content>









像这样我的代码有一直在......................

I have used Masterpage.

In the child pages, I added UpdatePanel and properties of UpdatePanel and Triggers also.

But child pages are still refreshed.

How to avoid page refreshing in child pages for every PostBack?

Please help me on this.

I need very urgent.

<asp:contenetplaceholder id="main" runat="server">
<asp:scriptmanager id="scriptmanager1" runat=server">
<asp:updatepanel id="updatemain" updatemode="conditional">
<asp:content>
<asp:Dropdownlist id="ddlcity" runat="server"><asp:Dropdownlist>
<asp:content>




Like this my code has been going......................

推荐答案

利用UpdateMode。有不同的价值此属性定义何时刷新页面。

SG
make use of UpdateMode. There are different value of this property which define when to refresh the page.
SG


检查以下msdn文章



http://msdn.microsoft.com/ en-us / library / system.web.ui.updatepanel.updatemode.aspx [ ^ ]
Check below msdn article

http://msdn.microsoft.com/en-us/library/system.web.ui.updatepanel.updatemode.aspx[^]


When an UpdatePanel control is not inside another UpdatePanel control, the panel is updated according to the settings of the UpdateMode and ChildrenAsTriggers properties, together with the collection of triggers. When an UpdatePanel control is inside another UpdatePanel control, the child panel is automatically updated when the parent panel is updated.

The content of an UpdatePanel control is updated in the following circumstances:
•
If the UpdateMode property is set to Always, the UpdatePanel control's content is updated on every postback that originates from anywhere on the page. This includes asynchronous postbacks from controls that are inside other UpdatePanel controls and postbacks from controls that are not inside UpdatePanel controls.

•
If the UpdatePanel control is nested inside another UpdatePanel control and the parent update panel is updated.

•
If the UpdateMode property is set to Conditional, and one of the following conditions occurs:
◦
You call the Update method of the UpdatePanel control explicitly.

◦
The postback is caused by a control that is defined as a trigger by using the Triggers property of the UpdatePanel control. In this scenario, the control explicitly triggers an update of the panel content. The control can be either inside or outside the UpdatePanel control that defines the trigger.

◦
The ChildrenAsTriggers property is set to true and a child control of the UpdatePanel control causes a postback. A child control of a nested UpdatePanel control does not cause an update to the outer UpdatePanel control unless it is explicitly defined as a trigger.


这篇关于如何避免页面刷新使用更新面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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