My contemplations and diurnal novelties are publicized here


Recommended solution: move the CrystalReportViewer control’s binding code to the Init event

The solution for the CrystalReportViewer control is to move your report binding code to the Init event, which occurs before ViewState is restored.

This solution raises one complication. Since the Init event is coded against less commonly than the Load event, it is harder to access. In Visual Studio .NET 2002 or 2003 Web or Windows projects, the Init event handling code is located within the Web Form Designer Generated code region, an area that is typically hidden and reserved for generated code.

To resolve this, the following approach is recommended:

  • Extract all CrystalReportViewer binding and configuration code into a private helper method named ConfigureCrystalReports().
  • Within the Web Form Designer Generated code region, place only a single line of code in the Page_Init() event handler or OnInit() event raising method: a call to the ConfigureCrystalReports() helper method.

http://msdn.microsoft.com/en-us/library/ms225455%28VS.80%29.aspx

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: