Binding Repeater in Page_PreRender

S

Sparhawk

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
 
E

Eliyahu Goldin

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top