SharePoint 2010:使用 UpdatePanel 的连接提供程序 Web 部件出现问题
我可能会以完全错误的方式处理这个问题,但这就是我正在做的事情:
我有 2 个自定义 Web 部件:公司日历和约会列表。两者都是可视化 Web 部件,并且都包含 UpdatePanel 控件。日历提供日期,约会列表消耗日期。当日历部分中选定的日期发生更改时,约会列表会收到通知。 UpdatePanel 的目的是防止整个页面被刷新。
当页面加载时,这工作正常。但是,当日历日期更改时,会引发回发。预约部分已刷新,但提供商链接为空。 (即连接未显式重新初始化)因此无法从提供程序(日历)获取日期。
我尝试将提供程序保存在 ViewState 中,但收到一条错误消息,指出日历部分未标记为可序列化。此时我开始怀疑我是否做错了:-/
应该如何完成?
I might be going about this in totally the wrong way but this is what I'm doing:
I have 2 custom web parts: a company calendar and an appointment list. Both are visual webparts and both contain an UpdatePanel control. The calendar provides a date and the appointment list consumes a date. When the selected date in the calendar part changes the appointment list is notified. The UpdatePanel is intended to prevent the whole page from being refreshed.
This works fine when the page is loaded. However, when the calendar date is changed, a postback is raised. The appointment part is refreshed but the provider link is null. (i.e. the connection is not explicitly reinitialised) Therefore it is not possible to fetch the date from the provider (Calendar).
I tried to save the provider in the ViewState but I get an error saying that the calendar part is not marked as serialisable. At this point I start to wonder if I'm doing this wrong :-/
How should this be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是我让它发挥作用的方式。
This is how I got it to work.