Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Binding Repeater in Page_PreRender

Reply
Thread Tools

Binding Repeater in Page_PreRender

 
 
Sparhawk
Guest
Posts: n/a
 
      09-04-2004
I ran into troubles binding my repeater controls in Page_PreRender.
The problem is that the Repeater_ItemCommand does not fire if the
control is bound in Page_PreRender. It works fine if I am binding in
Page_Load.

Probably I am missing something here. WHY doesn't it work?

I like to move much of by databinding to Page_PreRender because of the
following problem:

Page_Load reads all data and does databinding
Events are handled, data is changed and I have to do data loading and
binding again.

This is why I try to load all data AFTER handling user events (clicks,
....) whenever possible (i.e. in Page_PreRender).

Am I violating a design principle here?

Thanks for help,
Sparhawk
 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      09-05-2004
Looks like you are. PreRender is supposed to be the last touch to your page.
If you want to avois reloading data, collect all values affecting data
loading in the Page_Load. You can use __EVENTTARGET and __EVENTARGUMENT
parameters to find out who caused the postback.

Eliyahu

"Sparhawk" <> wrote in message
news: om...
> I ran into troubles binding my repeater controls in Page_PreRender.
> The problem is that the Repeater_ItemCommand does not fire if the
> control is bound in Page_PreRender. It works fine if I am binding in
> Page_Load.
>
> Probably I am missing something here. WHY doesn't it work?
>
> I like to move much of by databinding to Page_PreRender because of the
> following problem:
>
> Page_Load reads all data and does databinding
> Events are handled, data is changed and I have to do data loading and
> binding again.
>
> This is why I try to load all data AFTER handling user events (clicks,
> ...) whenever possible (i.e. in Page_PreRender).
>
> Am I violating a design principle here?
>
> Thanks for help,
> Sparhawk



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
page_prerender Ashish ASP .Net 1 09-25-2004 04:59 AM
Page_Prerender Ashish ASP .Net 0 09-24-2004 01:06 PM
Problem with binding in Page_PreRender PokerJoker ASP .Net Datagrid Control 0 08-30-2004 04:15 PM
Can EventHandler fire in Page_PreRender event? TPS ASP .Net 2 08-06-2004 02:58 PM
OnClick Handler for Buttons added During Page_PreRender? How? Sky Sigal ASP .Net 0 08-03-2004 07:16 PM



Advertisments