Question

I have been led to believe that the best point to bind your controls is the PreRender. As all the controls are ready and this is the last stage before rendering etc. Is this correct or should controls be bound at a different point?

Many Thanks

Louis

Was it helpful?

Solution

I agree with binding at PreRender.
Refer to the life cycle. As you can see, PreRender occurs after the control events (such as clicking), which is essential when having to rebind new/modified data after the users submits the form with a click of some sort.

But if you do not have to do binding based on user interactivity, then for the most part the place you put is irrelevant.

Make no mistake, though, depending on your logic, some bindings may have to occur before the control events for them to interact with the bound data.

OTHER TIPS

Here is the page life "bible" that I use!

http://msdn.microsoft.com/en-us/library/ms178472.aspx

I would bind your controls at Page_Load

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top