如何更新特定的updatepanel

编程入门 行业动态 更新时间:2024-10-28 21:14:41
本文介绍了如何更新特定的updatepanel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在页面上有多个更新面板。其中有一个特定面板中的fileupdate控件。要上传文档,我必须使用ScriptManager.GetCurrent(this.Page).RegisterPostBackControl(btnDocument)注册提交按钮。但是点击此按钮可以刷新所有更新面板。 我尝试过: 我想只更新包含fileupload控件的updatepanel。我尝试了很多但却无法做到。这该怎么做。请帮助

解决方案

将 UpdateMode 设置为条件所有 UpdatePanels

UpdateMode =有条件

并通过调用更新方法更新/刷新特定的 UpdatePanel

updatepanelName.Update();

请参阅此什么是UpdatePanel中UpdateMode的主要用途? | ASP.NET论坛 [ ^ ]

i have multiple updatepanels on page. Out of them there is a fileupdate control in a specific panel. To upload document i have to register the submit button using ScriptManager.GetCurrent(this.Page).RegisterPostBackControl(btnDocument). But on clicking this button it is refreshing all updatepanels. What I have tried: I want to update only the updatepanel that contains fileupload control. I tried a lot but not able to do. How to do this. Please help

解决方案

Set the UpdateMode as Conditional for all the UpdatePanels

UpdateMode="Conditional"

and update/refresh the particular UpdatePanel by calling Update method

updatepanelName.Update();

refer this What is the main purpose of UpdateMode in UpdatePanel ? | The ASP.NET Forums[^]

更多推荐

如何更新特定的updatepanel

本文发布于:2023-11-25 00:16:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627508.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:updatepanel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!