H
HP
Hi there
The problem of dynamically created controls vs viewstate is widely
known one. To access values of controls they have to be recreated on
Page_Load.
Unfortunately it causes many problems in the following (rather common,
I guess) scenario:
The controls are created dynamically. Their number and contents
depends on some DB values. User can add/delete data which should cause
changing the number of controls.
The problem:
Controls have to be drawn during page_load. Events have to be handled
during handlers cycle which occurs AFTER page_load. So if user changes
the state of database, the controls will be drawn based on data
fetched BEFORE the new changes are applied.
I'm trying to overcome this by checking on pageload which button was
fired (by iterating through Request.Form) but it's a rather dirty
solution.
thanks for your ideas
HP
The problem of dynamically created controls vs viewstate is widely
known one. To access values of controls they have to be recreated on
Page_Load.
Unfortunately it causes many problems in the following (rather common,
I guess) scenario:
The controls are created dynamically. Their number and contents
depends on some DB values. User can add/delete data which should cause
changing the number of controls.
The problem:
Controls have to be drawn during page_load. Events have to be handled
during handlers cycle which occurs AFTER page_load. So if user changes
the state of database, the controls will be drawn based on data
fetched BEFORE the new changes are applied.
I'm trying to overcome this by checking on pageload which button was
fired (by iterating through Request.Form) but it's a rather dirty
solution.
thanks for your ideas
HP