Issues with Custom Server Controls and Events in the ASP.NET page lifecycle
===

I am starting to go nuts with this one, it "seems" I can't get this to work in an elegant way and I'm sure i should be able to.

On the righthand side of the page I dynamically create Custom Server controls  that have events in them that fire, I have proved this bit works in testing.

I have a Treeview on the left side of the page and this is autopopulated at page load assuming it is not a postback, if it is then its viewstate handles this nicely. When you click on one of the branches of the tree it will post back and when the event fires it will then populate the right side with new custom server controls that hold the inforation relevant to what branch you clicked.  The right panel always populates with the correct controls, however the events don't fire when they are clicked as the new branch Id is only know after the page_load event  (when the treeview event fires) which is too late for all the Event cleverness to register I think.

I have looked into using Response.Redirect, but then I lose the viewstate on the Treeview so have started looking at forcing a Javascript post back but haven't got very far with that.

I really can't believe this is an unusual problem so hopeing there is an elegant solution. If its just i am going about it the total wrong way then happy to change all the logic if we can get this to work!!

Many many Thanks!!

Matt

