Events LifeCicle

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Im reading that this is the Control Execution Lifecycle

Initialize, Load View state Process postback data, load, send postback change notifications, handle posrback events, prerender, save state, render, dispose, unloa

My questions about this are

1) All this methods, and events are executed into the server

2) Its a good way to do this? (if i have for example a button) in the method Onclick, add to the session a value? or maybe i have to add before

3) If i have two separated webcustomcontrols and a page aspx. If i add into the aspx the two webcontrols i would like to comunicate each of the separated controls. (its a good solution using Sessions to comunicate both? (for example if i click in a button place inside a webcustomcontrol, i add into the session a key, and the another webcustomcontrol in the method prerender read the key and change some values

Thanks for the answers
Josema.
 
Hi Josema.

1) All this methods, and events are executed into the server?
yes they are since you have runat =server ( ie it is a server side
control)

2) Its a good way to do this? (if i have for example a button) in the
method Onclick, add to the session a value? or maybe i have to add before?

it really depend on your design but generally you can do that .

3) If i have two separated webcustomcontrols and a page aspx. If i add into
the aspx the two webcontrols i would like to comunicate each of the
separated controls. (its a good solution using Sessions to comunicate both?
(for example if i click in a button place inside a webcustomcontrol, i add
into the session a key, and the another webcustomcontrol in the method
prerender read the key and change some

You really have to take care while doing that , note that all event
handlers are executed at the server , you can't control the order of
execution ( if more than one event were fired before a postback , you can
not know which handler will be executed first ) so if you don't take that
in mind you might see unexpected result that doesn't match the logic you
have in mind .
One way to do that is to make every control cause a
postback , this way you know that once an event is fired on that control ,
the page will be postedback at once( now you can depend on the order of
event firing ) . however , this could be a great overhead.



values)Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 

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

Back
Top