Skip to main content
.NET Framework 4.5.2+
  • The page you are viewing does not exist in the .NET 6.0+ platform documentation. This link will take you to the parent topic of the current section.

WebApplication.ControlsCreating Event

Occurs before creating controls for the Web Forms page.

Namespace: DevExpress.ExpressApp.Web

Assembly: DevExpress.ExpressApp.Web.v23.2.dll

NuGet Package: DevExpress.ExpressApp.Web

Declaration

public event EventHandler<ControlsCreatingEventArgs> ControlsCreating

Event Data

The ControlsCreating event's data class is ControlsCreatingEventArgs. The following properties provide information specific to this event:

Property Description
Page Gets the Web Forms page.

Remarks

The ControlsCreating event is raised as the result of executing the WebApplication.CreateControls method. Handle this event to access a Page object, before its controls are created. This object is accessible via the ControlsCreatingEventArgs.Page parameter.

using DevExpress.ExpressApp.Web;
// ...
public class MyController : Controller {
    protected override void OnActivated() {
        base.OnActivated();
        ((WebApplication)Application).ControlsCreating += Instance_ControlsCreating;
    }
    private void Instance_ControlsCreating(object sender, ControlsCreatingEventArgs e) {
        // Access the Page object via the e.Page parameter:
        e.Page.PreRender += Page_PreRender;
        // ...
    }
    // ...
    protected override void OnDeactivated() {
        WebApplication webApplication = ((WebApplication)Application);
        if(webApplication != null) {
            webApplication.ControlsCreating -= Instance_ControlsCreating;
        }
        base.OnDeactivated();
    }
}
See Also