View Single Post
 
Old April 23rd, 2007, 06:21 PM
Raconteur Raconteur is offline
Authorized User
 
Join Date: Apr 2007
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Event order problem with TreeView

Hi all,

I have a problem with the TreeView and PlaceHolder controls. I have a TV that is populating a PH with a UserControl based on the selection.

The UC registers some JavaScript when it loads to do a bunch of client-side processing that I need.

Here is the problem... When the TreeView changes (a new node is selected) the Page_Load fires before the SelectionNodeChanged event. This means that the old UC entered in the PH is registering its client script, and the subsequent calls to do the same are ignored.

Is there any way to either:
1) Test the TV to see if it is in the process of changing (ala IsSelectionChanging or something to that effect).
2) Remove a client script once it is registered? These things are keyed, and it seems that until the page is actually pushed, there should be a way to dig in a dump the value from the ClientScriptManager, but I cannot find a way in to do that.

Any input GREATLY appreciated!

Cheers,

Chris