Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Handling server side events before CreateChildControls

Reply
Thread Tools

Handling server side events before CreateChildControls

 
 
Chris
Guest
Posts: n/a
 
      02-22-2008

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
 
Reply With Quote
 
 
 
 
Chris
Guest
Posts: n/a
 
      02-22-2008
On Feb 22, 10:01 am, Chris <(E-Mail Removed)> 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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation before or after CreateChildControls Paul ASP .Net 0 09-15-2006 01:53 AM
CreateChildControls before LoadViewState = Bug in DataGrid and Repeater Ferret ASP .Net 3 12-03-2004 04:22 PM
How to force the child controls OnClick event before the parent controls CreateChildControls method? Arulraja ASP .Net 3 10-17-2003 04:22 PM
Capturing Events before CreateChildControls in Composite Control Lucas Tam ASP .Net 1 08-17-2003 05:02 PM
CreateChildControls Event before Click Event Mark Sisson ASP .Net Building Controls 1 07-17-2003 03:46 AM



Advertisments