Page event does not fire at all

I try to use it Page_LoadCompletein my user control myusercontrol.ascx.cs, but it does not start, I added a breakpoint and nothing, is it possible that the user control does not support this event? and if so, then what can I use instead?

+5
source share
2 answers

The event LoadCompleteonly happens on Page. For a control, if you want to do something after the events of other controls have been fired Load, something you get is something like this PreRender.

Alternatively, you can attach to the Page event LoadCompletein your control file. But AFAIK will not happen automatically.

+9
source

LoadComplete does not connect automatically. You will have to do it yourself.

    protected void Page_Load(object sender, EventArgs e)
    {
        Page.LoadComplete += new EventHandler(Page_LoadComplete);
    }

    void Page_LoadComplete(object sender, EventArgs e)
    {
        //Do your deed
    }

Link: http://connect.microsoft.com/VisualStudio/feedback/details/103322/page-loadcomplete-doesnt-fire-in-custom-controls

+22
source

All Articles