As known, custom control's onload() method is called after container's page_load event fires. So in Page_Load handler, custom control hasn't been fully initialized. Although we can do something on custom control in prerender handler, but sometimes we need custom control ready before anything else can do.
Here is an example:
If we have an authenticate custom control and we want everything else run after check the permission of user, we have to make sure custom control is ready. But since onload hasn't been invoked, the codes in it hasn't been executed yet.
The work around is put all code in onload to anothe method, then call it directly from container page's Page_Load handler.
No comments:
Post a Comment