ChartDirector 7.1 (.NET Edition)

WebChartViewer.OnPageInit


Usage

[C#]public static void OnPageInit(System.Web.UI.Page currentPage);
[VB]Public Shared Sub OnPageInit(currentPage As System.Web.UI.Page)

Description

Handles the Web Form Init event to support dynamically created WebChartViewer or WebViewPortControl.

This method is for supporting programs that may create WebChartViewer or WebViewPortControl dynamically at runtime. It is not needed if the controls are created during design time (eg. created by using ASP.NET tags, or by dragging and dropping the control onto the Web Form in Visual Studio.NET.)

Certain functions of the WebChartViewer and WebViewPortControl needs to be performed in the Web Form Init event. If the control is dynamically created after the Init event (such as in the Page Load event), it would not receive the Init event and may not work properly. In this case, the OnPageInit method can be inserted into the Init event handler to perform those functions. This method is a Shared (in VB) or static (in C#) method, and it can be called without creating any instance of WebChartViewer or WebViewPortControl.

[VB]WebChartViewer.OnPageInit(Me)
[C#]WebChartViewer.OnPageInit(this);

Note that even if the WebChartViewer or WebViewPortControl is only created under certain conditions (eg. if a certain flag is set), the OnPageInit method should still run irrespective of whether the WebChartViewer or WebViewPortControl is actually created.

Arguments

ArgumentDefaultDescription
currentPage(Mandatory)The current Web Form.

Return Value

None