difference between PreRender event and Page_Load event

Discussion in 'ASP .Net' started by Jimmy, Apr 26, 2005.

  1. Jimmy

    Jimmy Guest

    Hi

    Can someone explain to me what the difference is between a PreRender event
    and the Page Load event for a webform?

    ch Jimmy
    Jimmy, Apr 26, 2005
    #1
    1. Advertising

  2. Jimmy

    Josh Guest

    ..

    page_load is before the viewstate is reinstated, and prerender after the
    viewstate is restored before the page is drawn to the reposnse stream.
    Josh, Apr 26, 2005
    #2
    1. Advertising

  3. Jimmy

    Jimmy Guest

    thanks Josh
    "Josh" <> wrote in message
    news:...
    > .
    >
    > page_load is before the viewstate is reinstated, and prerender after the
    > viewstate is restored before the page is drawn to the reposnse stream.
    >
    >
    Jimmy, Apr 26, 2005
    #3
  4. Jimmy

    Brock Allen Guest

    > page_load is before the viewstate is reinstated, and prerender after
    > the viewstate is restored before the page is drawn to the reposnse
    > stream.



    Actually, this is not correct. Page_Load happens *after* ViewState and PostData
    is set into all of your server side controls by ASP.NET (modulo any dynamic
    controls being created on the page). Page_Init is the event fired prior to
    ViewState and PostData being reinstated. Page_Load is where you typically
    do any page wide initilization. Page_PreRedner is the last even you have
    a chance to handle prior to the page's state being rendered into HTML. Page_Load
    is the more typical event to work with. I can't think of a single time I've
    needed to handle Page_PreRender in the 4+ years I've been doing ASP.NET (not
    to say there aren't situations, but they're more rare than using Page_Load).

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen
    Brock Allen, Apr 26, 2005
    #4
  5. Jimmy

    Josh Guest

    > I can't think of a single time I've needed to handle Page_PreRender in
    > the 4+ years I've been doing ASP.NET (not to say there aren't situations,
    > but they're more rare than using Page_Load).


    I have done it once in 2 years. I had dynamicly loaded controls where the
    event fired on one effected the setting of another etc etc, but there you
    go.
    Josh, Apr 27, 2005
    #5
  6. =?Utf-8?B?Sm9yZ2UgTCBNYXRvcyBbTUNTRC5ORVRd?=, Apr 27, 2005
    #6
    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. jakk
    Replies:
    4
    Views:
    12,028
  2. ad
    Replies:
    6
    Views:
    35,397
    Joerg Jooss
    Nov 16, 2005
  3. Mariella Bakker
    Replies:
    1
    Views:
    5,211
    John Timney \( MVP \)
    May 8, 2006
  4. rockdale
    Replies:
    1
    Views:
    647
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Nov 16, 2006
  5. archana
    Replies:
    1
    Views:
    2,743
    Eliyahu Goldin
    Mar 14, 2007
Loading...

Share This Page