protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!Page.IsPostBack && PageLoad != null) { PageLoad.Invoke(); } }
public void MakeRequest(Uri address) { // emulate request System.Threading.Thread.Sleep(1000); bool loaded = (new Random().Next(100) <= 40) ? true : false; if (loaded) { // notify client code PageLoad?.Invoke(this, new EventArgs()); Ready = true; } else { PageError?.Invoke(this, new EventArgs()); Ready = true; } }
protected override void OnLoadComplete(EventArgs e) { base.OnLoadComplete(e); PageLoad?.Invoke(this, EventArgs.Empty); }