asp.net 多个 updatepanels 持有带有 jquery 部分回发问题的用户控件

发布于 2024-09-12 09:29:26 字数 224 浏览 2 评论 0原文

我有一个页面,在不同的更新面板中包含多个用户控件。用户控件包括用于计算某些值和绘制图形的 jquery 调用(jquery 不调用服务器方法)。

问题是,无论刷新什么 updatepanel,所有 jquery 调用都会再次处理。我认为问题的出现是因为我使用用户控件的页面加载方法来执行 jquery 方法调用。

我想知道是否有办法阻止其他用户控件调用其页面加载方法或刷新。

提前致谢。

I have a page with several user controls in different updatepanels. The user controls includes jquery calls which are used to calculate some values and draw graphs(no server methods are called from jquery).

The problem is that, whatever updatepanel is refreshed, all of the jquery calls are processed again. I think the problem arises because i use pageload methods of the usercontrols to do jquery method calls.

I wonder whether there is a way to stop other user controls from calling their pageload methods or refreshing.

thanks in advance.

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

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

发布评论

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

评论(1

森罗 2024-09-19 09:29:26

也许这会有所帮助...当您在渲染控件的页面上包含自定义控件时,这并不完全是一个答案

HTML 包含在页面中,因为它与所有 JavaScript 和 css 一起使用(您可以执行“查看页面源代码”)并进行检查。

因此,实际上,您的页面(包含用户控件的页面)中可以有 3 个页面加载,位于不同的标签中,因此当任何更新面板刷新时,所有页面加载都会被调用。

maybe this would help...not exactly an answer

when you include custom controls on a page on rendering the controls HTML is included in the page as it is with all JavaScript and css( you can do a View page Source) and check that.

and so in effect there can be 3 pageloads in your page(the page that has the user controls included) in different tags and as such all are getting called when any update panel refreshes.

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