.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.
.NET Core 3.0+
The page you are viewing does not exist in the .NET Core 3.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.v20.1.dll

Declaration

public event EventHandler<ControlsCreatingEventArgs> ControlsCreating
Public Event ControlsCreating As EventHandler(Of ControlsCreatingEventArgs)

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