父回发后从更新面板中删除动态控件及其视图状态的问题
一些背景 -
我正在开发一个网络应用程序,供员工提交休假请求。请求页面使用用户控件,用户可以在其中输入休息日的日期/原因。用户可以在每天休息时动态添加一个新的页面,这些都被添加到更新面板中。
编辑弄清楚发生了什么,只是不知道如何解决它。
好的,我遇到的问题是当用户返回编辑其请求并删除子请求时
====================
请求 1 请求 1
= ===================
请求2==>请求 3
========== ==========
请求 3
==========
请求 2 控件通过异步请求从 updatepanel 中删除,没有任何问题并正确显示,我遇到的问题是提交父页面并重新创建控件时。
==========
请求 1
==========
旧的过时数据而不是请求 3
==========
而不是显示请求 1 和请求 3 3 我收到请求 1 以及请求 2 中我不再需要的陈旧数据。
如果我强制页面在父提交上绘制额外的控件,我会看到
==========
请求 1
==========
旧的过时数据
========= =
请求 3
==========
所以数据仍然存在,只是不在我想要的位置,如何摆脱陈旧的记录并只显示活动请求?
任何想法将不胜感激。
谢谢,
贾斯汀
Some background-
I am developing a web application for employess to submit requests for time off work. The request page uses a user control that they enter the date/reason for the day off into. The user can dynamically add a new one to the page for each day off want, these are all added to an updatepanel.
Edit figured out whats going on, just not sure how to fix it.
Ok so the problem I am having is when a user goes back in to edit their request and deletes on of the sub requests
========== ==========
Request 1 Request 1
========== ==========
Request 2 ==> Request 3
========== ==========
Request 3
==========
The request 2 control is removed fine from the updatepanel via async request with no problem and shows up correctly, the problem i have is when the parent page is submitted and the controls are recreated.
==========
Request 1
==========
Old stale data instead of request 3
==========
instead of showing request 1 & 3 i am getting request 1 along with stale data from request 2 that i no longer need.
if i force the page to draw an extra control on the parent submit i see
==========
Request 1
==========
Old stale data
==========
Request 3
==========
So the data is still there just not in the place i want it to be, how do I get get rid of the stale record and get just the active requests to show up?
Any ideas would be appreciated.
Thx,
Justin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 ViewStateModeById 解决了问题
Resolved issue by using ViewStateModeById