H
Henke
Hello,
I have developed some ASP.Net web applications during the past weeks and
have encountered the fact that dynamic controls needs to be recreated on
each postback. What is the experience of the ASP.Net development community
regarding this? Are there any good approach about managing the dynamic
controls and the recreation.
Let me give you an example:
I create a list of items from a SQL query, for each item I create an
ImageButton with a delete button. All items are
added to a Table webcontrol. Each Delete button is connected to a common
eventhandler which deletes the row and updates the database. To solve this I
have added the table to a session variable which I then read back in the
Page.Init event (on each postback) and I have to recreate all the Delete
buttons which is a real pain because the number of delete buttons differs
from case to case.
What is your experience of this situation and are there any common
guidelines from Microsoft on this?
Have a nice weekend
Regards,
// Henke
I have developed some ASP.Net web applications during the past weeks and
have encountered the fact that dynamic controls needs to be recreated on
each postback. What is the experience of the ASP.Net development community
regarding this? Are there any good approach about managing the dynamic
controls and the recreation.
Let me give you an example:
I create a list of items from a SQL query, for each item I create an
ImageButton with a delete button. All items are
added to a Table webcontrol. Each Delete button is connected to a common
eventhandler which deletes the row and updates the database. To solve this I
have added the table to a session variable which I then read back in the
Page.Init event (on each postback) and I have to recreate all the Delete
buttons which is a real pain because the number of delete buttons differs
from case to case.
What is your experience of this situation and are there any common
guidelines from Microsoft on this?
Have a nice weekend
Regards,
// Henke