Events LifeCycle

J

Josema

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.
 
J

Josh

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, unload
My questions about this are:

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

Yes they are.
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?

You do not need to use the Session unless you want to do something outside
of the page your on. If you want to persist values while on the same page,
you can add them into the "Viewstate" object of the page.

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)

It's not common to use "prerender". Yes you could use the Session to pass
the values around, but you have to ensure that the value is written to the
Session before you read it back.

Alternatively you might try adding a public property to one of the controls,
that the other control could access.
 

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

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,173
Latest member
GeraldReund
Top