Share via


Tag-based Application Development Model

ASP.NET version 2.0 has brought many changes that enhance Crystal Reports for Visual Studio. One of the most significant changes is an expanded use of XML in the ASPX page to become a complete tag-based application development model.

In earlier versions of ASP.NET, XML tags have already played a significant role:

  • XML tags represented each visual .NET control in the ASPX page.
  • Properties associated with each tag enabled basic settings to be configured directly in the ASPX page.
  • Nested tags were used for some of the more complex controls, for detailed configurations.

In ASP.NET 2.0, XML has been expanded into a full tag-based application development model. The DataSource framework is a key component of this model: a completely tag-based methodology to access and interact with the database, without having to write code.

The adoption of the tag-based application development model has been further encouraged in ASP.NET 2.0 with two GUI innovations:

  • Smart Tasks.

    The Smart Task panel appears when a .NET control is added to the Web Form. Smart Tasks allow you to configure features easily. Each selection made in the Smart Task panel auto-generates property and nested tag information within the XML control tags.

  • Drag-and-drop integration of the DataSource control from the Server Explorer window.

    When you drag a table from the Server Explorer window onto the Web Form, a DataGrid is auto-generated. The DataGrid is pre-configured to display data from the corresponding database table, through its associated DataSource control. This is seen both graphically (Design view) as well as text-based declarative XML (Source view). You can easily modify the DataGrid, by selecting options in the Smart Task panel, to have the DataGrid sort, edit, update, and delete records. Any data changes are then propagated back to the underlying database table.

Impacts on the CrystalReportViewer control and Crystal Reports

Crystal Reports takes advantage of the tag-based application development model, through use of a new CrystalReportSource control (which implements the DataSource control framework). The CrystalReportSource control encapsulates a Crystal report.

Note

For more information on the CrystalReportSource control, see CrystalReportSource Control.

When you use the tag-based application development model, the CrystalReportViewer control is associated with the CrystalReportSource control through the selections that you make in the Smart Task panel. The selections are then represented in the XML tags that are generated for the ASPX page.

Note

The new relationship of the CrystalReportViewer control to the CrystalReportSource control mirrors the structure that is used for a DataGrid control (or any other .NET visual control) and the SqlDataSource control.

Other development models

Remember that in ASP.NET 2.0, the tag-based application model is an optional framework. Some developers may prefer to use a coding development model for maximum flexibility in configuration and extensibility. In that case, use only the ASP.NET version 1.0 tag model, and address functionality by writing code in the code-behind class.

Note

In ASP.NET 2.0, the class that is associated with the ASPX page is now referred to as a code-behind class, due to a change in the page architecture. Instead of a code-behind class that works as the base class to the ASPX page, the ASPX page and its related class have been reconfigured as two segments of a single class that is exposed as one class in the Object Browser. This division is made possible by partial classes, which is a new feature in the .NET Framework version 2.0.