Datalist 在回发时不保留值

发布于 2024-07-22 01:48:12 字数 492 浏览 4 评论 0原文

我有一个 datalist 控件,当导致回发的控件位于 Datalist 所在的更新面板之外时,它不会在回发期间保留其值。我已验证该用户控件及其所有父控件的视图状态处于打开状态。

我的基本情况是我有一个数据列表,其中包含页面上的用户控件。 当用户在网格中选择几行并按下按钮时,数据表将在后端填充并分配给 Datalist,该 Datalist 的项目模板设置为 UserControl。 在 ItemDataBound 上,我在控件中设置了特定属性,这些属性将该控件上的消息自定义为特定项目。 然后使用 AJAX Control Toolkit Modal Popup[ Extender 弹出。 当用户按下“保存”时,整个页面都会回发。 从用户控件收集数据并将其保存到数据库,然后弹出窗口消失。 我当前遇到的问题是,当按下保存按钮时,DataList 有 0 个项目,而不是适当的数量。 这个问题是在我们从 .NET 2.0 升级到 .NET 3.5 后才开始出现的。

有什么想法可能导致这种情况吗?

I have a datalist control that is not retaining it values during postback when the control causing the postback is outside of the update panel that the Datalist resides in. I have verified that viewstate is on for that usercontrol as well as all its parent controls.

My basic situation is that I have a Datalist that contains a user control on a page. When the user selects several rows in a grid and presses a button, a datatable is filled on the backend and assigned to the Datalist which has its item template set to the UserControl. On ItemDataBound I set specific properties in the control which customize the messages on that control to the specific item. This is then popped up using the AJAX Control Toolkit Modal Popup[ Extender. When the user presses Save the whole page posts back. Data is collected from the user controls and saved to the DB and the popup disappears. The issue I am currently having is that the DataList has 0 items when the save button is pressed instead of the appropriate number. THis issue just started appearing after we upgraded from .NET 2.0 to .NET 3.5.

Any ideas what might be causing this?

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

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

发布评论

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

评论(1

北笙凉宸 2024-07-29 01:48:12

这是由于该页面上的 Infragistics 网格控件中的错误所致。 一旦我们升级到最新的修补程序,它就解决了这个问题。 不过,PITA 真是太好找了。

This was due to a bug in the Infragistics Grid Control that was also located on that page. As soon as we upgraded to the latest hotfix it solved the issue. What a PITA to find though.

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