Design consideration regarding dynamic controls

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top