当同一个更新面板进行回发时,如何阻止更新面板刷新

发布于 2024-08-16 06:50:54 字数 111 浏览 2 评论 0 原文

我有一个更新面板,里面有一个链接按钮。 updatepanel 将其 updatemode 设置为有条件的。据我了解,无论更新模式是否设置为条件,如果面板内部的某些内容启动回发,它都会刷新面板。这附近还有吗?

I have an update panel with a linkbutton inside of it. The updatepanel has its updatemode set to conditional. From what I understand, regardless if the updatemode is set to conditional, it will refresh the panel, if something inside of it initiates the postback. Is there anyway around this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

林空鹿饮溪 2024-08-23 06:50:54

为什么不在更新面板上设置 ChildrenAsTriggers="false" 呢?那么更新模式必须是有条件的,但如果我理解正确,它就不会更新。

编辑:抱歉,刚刚意识到这是一个旧线程:(

Why don't you just set ChildrenAsTriggers="false" on the update panel? Update mode must be conditional then, but it won't update if I understand things correctly.

EDIT: Sorry, just realized it's an old thread :(

眼中杀气 2024-08-23 06:50:54

据我所知,将您想要避免回发的内容放在 updatepanel 之外。我还没有听说过其他替代方案,除非您通过 JavaScript 和 AJAX Web 服务手动更新 UI。

如果可以,但不知道情况,您可以考虑将该链接作为客户端链接,并让它执行您需要执行的任何操作...如:

执行此操作

你需要做什么?

Put the content you want to avoid the postback outside of the updatepanel, as far as I know. I haven't heard of another alternative, unless you manually update the UI via JavaScript and AJAX web services.

If you can, don't know the situation, you could consider having the link as a client-side link, and have it do whatever you need to do... as in:

<a href="javascript:void(0);" onclick="doThis();">Do This</a>

What do you need to do?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文