Dynamically created controls not refreshed

D

Dwight Johnson

I am building a website in VS2005. I basically have one page,
default.aspx, which contains placeholder objects into which I add
various controls that are dynamically created. I have a dropdownlist
that is created in the InitializeComponent event so I can do a
FindControl on it later to determine its new value when it is
selected. Based on this new value I will then get data from a database
and fill another placeholder on the page with a dynamically built
table containing labels and textboxes filled with the new data. This
process happens in the Page_Load, regardless of the state of
IsPostBack. When I debug the process, the dynamically-created controls
are all populated with the new data, but when the page appears, the
only data I ever see is the data from the first time that the page
loaded. Any ideas? I have done this same thing in VS2003 without a
problem. I'm completely baffled by this one.
 
D

Dwight Johnson

Just to clarify, I added a dropdownlist to the group of textboxes, and
the dropdown list always reflects the new data (?!) while the
textboxes remain unchanged.

Also, the new data appears in the textboxes when I return to the page
using a link on the page with a different querystring, but not when I
do an autopostback on the original dropdownlist that determines which
set of data is loaded into the page.

Is any of this making any sense to anyone?
 
D

Dwight Johnson

One more thing. When I made the textboxes ReadOnly = true, they all
get refreshed!

The good news is, my problem is solved.
The bad new: I still have no idea why.
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top