To add a Page_Init event handler to the code-beside class

Parent Previous Next

 

Report Application Server .NET SDK Developer Guide

To add a Page_Init event handler to the code-beside class


 







Typically the Page_Load event handler is used to enter Web Form configuration code in an ASP.NET Web application so that the code will be called during the Page.Load event.

However, the Crystal report configuration code needs to be called earlier, during the Page.Init event.

  1. If you are coding in Visual Basic, do the following:

NoteNote

This causes the top right drop-down list to be populated with all available events for this control.

The following event handler is added to your code-beside class:

Visual Basic

Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
End Sub

  1. If you are coding in C#, enter the Page_Init event handler using the exact syntax shown.

C#

private void Page_Init(object sender, EventArgs e)
{
}

NoteNote

In a C# Web form in Visual Studio 2005, any Page_Init, Page_Load or Page_PreRender event handler in the code-beside class is wired automatically to the Init, Load or PreRender event. The event handler signature must match exactly in order to be called.

This feature occurs when the Page directive, found at the top of the ASPX page in HTML view, has its AutoEventWireup parameter set to true.

Previous versions of Visual Studio .NET and Visual Basic Web forms in Visual Studio 2005 and newer always set the AutoEventWireup Page directive to False, but in C# Web forms in Visual Studio 2005 and newer the AutoEventWireup Page directive is omitted, setting it to its default setting of true.

  1. Finally, within the Page_Init event handler for either Visual Basic or C#, enter a call to the ConfigureCrystalReports() helper method.

Visual Basic

ConfigureCrystalReports()

C#

ConfigureCrystalReports();

From the File menu, click Save All.

Continue to To add a CrystalReportViewer control.

© 2021 SAP AG. All rights reserved.

http://www.sap.com/sapbusinessobjects/

Support services

http://service.sap.com/bosap-support/

Created with the Personal Edition of HelpNDoc: Easily create EPub books