Events LifeCycle

Discussion in 'ASP .Net Web Controls' started by Josema, Jun 4, 2004.

  1. Josema

    Josema 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.
     
    Josema, Jun 4, 2004
    #1
    1. Advertising

  2. Josema

    Josh Guest

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

    >
    > Thanks for the answers.
    > Josema.
     
    Josh, Jun 4, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Petr SIMUNEK

    viewstate - events - page lifecycle

    Petr SIMUNEK, Nov 18, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    600
    cbDevelopment
    Dec 12, 2005
  2. Replies:
    5
    Views:
    378
  3. Gary W. Smith

    Page lifecycle, specific events question.

    Gary W. Smith, Aug 28, 2007, in forum: ASP .Net
    Replies:
    6
    Views:
    820
    bruce barker
    Aug 28, 2007
  4. Marc
    Replies:
    2
    Views:
    630
    Sanjay Pais
    May 6, 2009
  5. Josema

    Events LifeCycle

    Josema, Jun 4, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    119
    Natty Gur
    Jun 5, 2004
Loading...

Share This Page