如何在asp.net中更新更新面板 [英] how to update update panel in asp.net

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

问题描述

我有两个更新面板,每个都有一个文本框,还有两个按钮。

我想点击button1然后更新panel1应该用它的文本框值刷新。当点击button2然后更新panel2应该刷新它的值。在asp.net中使用ajax。我怎么能这样做。

解决方案

将更新模式设置为有条件。

< asp: updatepanel id =   UpdatePanel1  < span class =code-string>< br mode =   hold xmlns:asp =  #unknown /> UpdateMode =  条件 
runat = server >







并在按钮上单击时编写代码,以便更新UpdatePanel



< pre lang =c#> UpdatePanel1.Update();


i have two update panel, and each have a textbox and also have the two button.
i want to click button1 then update panel1 should be refresh with it's textbox value. and when click on button2 then update panel2 should be refresh with it's value. using ajax in asp.net. how can i do this.

解决方案

set the update mode to conditional.

<asp:updatepanel id=""UpdatePanel1"<br" mode="hold" xmlns:asp="#unknown" />                  UpdateMode="Conditional"
                  runat="server">




and on the button click write the code when ever you want to update the UpdatePanel

UpdatePanel1.Update();


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

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