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.
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.
© 2017 Advanced Software Engineering Limited. All rights reserved.