View Single Post
Old 10-10-2008   #1 (permalink)
MCM


 
 

Update Panel not updating DOM

I have an asp.net page that contains an update panel. Within the update
panel, controls get added dynamically. During partial page post backs the
controls within the panel will change.

I have a javascript function that uses the ClientID of the dynamic controls
to perform certain operations on the client-side. With each partial page post
back, I dynamically recreate the javascript function using the ClientIDs of
the newly added controls. I use ScriptManager.RegisterStartupScript to add
the newly created script to the page.

Using debug, I stepped through and I can see that the controls and
javascript are all getting created correctly.

The javascript function runs correctly on the initial page load. But, on a
partial page postback, it is throwing a null exception in the client
javascript because it is searching for a ClientID that does not exist.

The DOM does not get updated with the new ClientIDs.

How can I force the DOM to update on a partial page postback?
My System SpecsSystem Spec