Why Repeater.ItemCreated is fired before Page_Load on postback

Discussion in 'ASP .Net' started by Philippe Camus, Mar 30, 2006.

  1. I didn't find any documentation about this behaviour.
    On postbacks the Repeater ItemCreated event is fired before Page_Load event
    It occurs for each item with empty RepeaterItemEventArgs.Item.DataItem.

    Does anybody know more about this strange behaviour?

    Thanks

    Philippe
     
    Philippe Camus, Mar 30, 2006
    #1
    1. Advertising

  2. ItemCreated is used on postback to recreate the repeater from the viewstate.
    It's normal that DataItem is going to be null. When the repeater is
    initially bound, it won't be null because there's an actual underlying
    datasource. Since the viewstate is used to rebuild it on postback, and not
    the datasource (which is lost), DataItem is null.

    I believe, but am not sure, that on postback ItemCreated is called by either
    the LoadViewState or PorcessPostbackData page events - both of which happen
    before Load.

    Karl
    --
    http://www.openmymind.net/



    "Philippe Camus" <> wrote in message
    news:Xns97968EDEA5166pcamussynapschcom@212.129.5.2...
    >I didn't find any documentation about this behaviour.
    > On postbacks the Repeater ItemCreated event is fired before Page_Load
    > event
    > It occurs for each item with empty RepeaterItemEventArgs.Item.DataItem.
    >
    > Does anybody know more about this strange behaviour?
    >
    > Thanks
    >
    > Philippe
     
    Karl Seguin [MVP], Mar 30, 2006
    #2
    1. Advertising

  3. Karl, Many thanks for these infos
    Regards,
    Philippe
     
    Philippe Camus, Mar 30, 2006
    #3
    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. Lars Netzel
    Replies:
    1
    Views:
    1,589
    Greg Burns
    Sep 10, 2004
  2. rockdale
    Replies:
    1
    Views:
    685
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Nov 16, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,138
    Smokey Grindel
    Dec 2, 2006
  4. Michal Valent
    Replies:
    2
    Views:
    427
    Michal Valent
    Nov 27, 2007
  5. Savvoulidis Iordanis
    Replies:
    3
    Views:
    539
    Savvoulidis Iordanis
    Aug 10, 2008
Loading...

Share This Page