[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.buildingcontrols

Handling server side events before CreateChildControls

Chris

2/22/2008 12:01:00 AM


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
1 Answer

Chris

2/22/2008 2:24:00 AM

0

On Feb 22, 10:01 am, Chris <Duk...@gmail.com> wrote:
> 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?