Handling server side events before CreateChildControls

C

Chris

Is it possible to handle server side events before
CreateChildControls?
e.g. If you have a treeview control and the user clicks on an expand
node what would happen would be CreateChildControls would be called
first to recreate the treeview as is and then the event would be fired
and you would need have to add new nodes to the current tree or
recreate the whole tree again with the added nodes. What would be
nicer would be if you knew before CreateChildControls that the user
had click an expand node and could create the resulting tree in the
first call to CreateChildControls.

Thanks
Chris
 
C

Chris

Is it possible to handle server side events before
CreateChildControls?
e.g. If you have a treeview control and the user clicks on an expand
node what would happen would be CreateChildControls would be called
first to recreate the treeview as is and then the event would be fired
and you would need have to add new nodes to the current tree or
recreate the whole tree again with the added nodes. What would be
nicer would be if you knew before CreateChildControls that the user
had click an expand node and could create the resulting tree in the
first call to CreateChildControls.

Thanks
Chris

ok I seem to have 2 possible solutions.

The first is just let the server side events occur after
CreateChildControls(). The downside to this is that I will have to
enforce CreateChildControls() to run a second time which means doing
everything twice and will be slower but should at least work.

The other solution seems to be to handle all the events client side
and from there manually send a postback event back and set the
argument to a string that contains all of the event information I need
and parse that string (Me.Page.Request.Params("__EVENTARGUMENT")) at
the beginning of CreateChildControls or maybe Init() and so handle it
before i create any child controls.

Does the second solution sound workable? Anyone done anything like
this before?
 

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,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top