开发者

Binding controls on PreRender

I have been led to believe that th开发者_运维知识库e 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


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜