开发者

Problem with dynamic controls and their viewstates on removal from updatepanel after parent postback

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

==========

开发者_C百科

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


Resolved issue by using ViewStateModeById

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜