Unable to get DataItem for Repeater item in RepeaterItem.PreRender.

Discussion in 'ASP .Net' started by Peter Rilling, May 18, 2005.

  1. In the Repeater.ItemCreated handler, I am hooking the RepeaterItem.PreRender
    method. This event fires when the RepeaterItem is being rendered, the
    problem is that I want access to the DataItem that the RepeaterItem was
    created from. Well, it appears the DataItem property is null in the
    RepeaterItem.PreRender event. Why is this.

    I have read about issues like this relating to Postbacks and ViewState, but
    I am rebinding each time the page is requested.
     
    Peter Rilling, May 18, 2005
    #1
    1. Advertising

  2. RE: Unable to get DataItem for Repeater item in RepeaterItem.PreRender

    Without viewing your code, it's hard to say what's wrong.

    Elton Wang

    "Peter Rilling" wrote:

    > In the Repeater.ItemCreated handler, I am hooking the RepeaterItem.PreRender
    > method. This event fires when the RepeaterItem is being rendered, the
    > problem is that I want access to the DataItem that the RepeaterItem was
    > created from. Well, it appears the DataItem property is null in the
    > RepeaterItem.PreRender event. Why is this.
    >
    > I have read about issues like this relating to Postbacks and ViewState, but
    > I am rebinding each time the page is requested.
    >
    >
    >
     
    =?Utf-8?B?RWx0b24gVw==?=, May 19, 2005
    #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. ric carrasquilla

    Getting DataItem from a RepeaterItem

    ric carrasquilla, Mar 1, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    4,899
    ric carrasquilla
    Mar 4, 2004
  2. =?Utf-8?B?RXJpYw==?=

    Repeater control -- Using e.Item.DataItem

    =?Utf-8?B?RXJpYw==?=, May 10, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    17,534
    ichi27
    Jun 2, 2011
  3. Replies:
    3
    Views:
    666
  4. Jeremy
    Replies:
    1
    Views:
    537
    bruce barker
    Jan 10, 2008
  5. Dave Adams

    Repeater e.item.dataitem null on postback

    Dave Adams, Oct 13, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    473
    Dave Adams
    Oct 13, 2003
Loading...

Share This Page