当同一个更新面板进行回发时,如何阻止更新面板刷新
我有一个更新面板,里面有一个链接按钮。 updatepanel 将其 updatemode 设置为有条件的。据我了解,无论更新模式是否设置为条件,如果面板内部的某些内容启动回发,它都会刷新面板。这附近还有吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我有一个更新面板,里面有一个链接按钮。 updatepanel 将其 updatemode 设置为有条件的。据我了解,无论更新模式是否设置为条件,如果面板内部的某些内容启动回发,它都会刷新面板。这附近还有吗?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
为什么不在更新面板上设置 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 :(
据我所知,将您想要避免回发的内容放在 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?