Part V: Customizing Generated Application Code

 


Part V: Customizing Generated Application Code

Code Customization Tutorial

N-Tier Architecture Overview

Pages and Code Files Generated

Classes and Methods Generated

The Page Lifecycle

Table Control and Record Control Lifecycle

Saving Data to the Database

Page Control Hierarchy

Referencing Page Controls in Code

Referencing Data Access Functions in Code

Handling Post Back Events

Best Practices for Code Customization

Where to add customizations?

What events to handle or methods to override?

Don’t Forget the IsPostBack Flag

Additional Page Lifecycle References

Extending Applications with the Code Customization Wizard

Selecting a Customization to Apply

Substituting Parameters into a Code Template

Applying the Code Customization to your Application

Adding Your Own Code Templates

Application Class Hierarchy

Page Classes

<PAGE> Class

BasePage Class

Record Classes

<TABLE>Record Class

Base<TABLE>Record Class

BaseRecord class

Table Classes

<TABLE>Table Class

Base<TABLE>Table Class

BaseTable Class

Field Classes

Validation

External DLL’s in Applications

Using External DLL’s in Applications

Making DLL’s CLS Compliant

Security and Authentication

Customizing Sign In and Sign Out Page Appearance

Customizing User Authentication Behavior

Overriding Security at the Page Level

Programmatically Accessing the Currently Logged-in User

Email Integration

Sending Email from an Application

Send Password by Email

Emailing the Contents of a Page

Configuring Email Server Authentication

Configuring the SMTP Email Server in Microsoft Windows

If You Have Problems Sending Email…

PDF Report Customization

Customizing PDF Report Configuration Files

Text Substitution Parameters for Titles, Headers, Footers and Columns

PDF Report Alignment Configuration

PDF Report Language and Culture-Based Configuration

Adding, Deleting and Rearranging Columns in PDF Reports

Customizing PDF Report Code

Microsoft Word Report Customization

Customizing Microsoft Word Report Configuration Files

Text Substitution Parameters for Titles, Headers, Footers and Columns

Microsoft Word Report Alignment Configuration

Microsoft Word Report Language and Culture-Based Configuration

Customizing Microsoft Word Report Code

Export to Excel Customization

Customizing the AddColumn Method

Customizing the ExportToExcel Method

Crystal Reports Application Development and Deployment

Creating a Crystal Reports Report File

Adding a Crystal Report to Your Iron Speed Designer Application

Adding Crystal Reports References to Your Project

Opening Crystal Reports PDF Files in Separate Browser Windows

Deploying a Crystal Reports Application

Compilation Errors

Code Customization Examples

Access ASPX Controls in Code-Behind Classes

Access Session State Information in Applications

Access Variables in the Data Access Layer

Access User Name and Password from Sign In Control

Adding Custom Functions to Your Application

Allow Only Active Users to Login

Catch Exceptions Raised in Custom Stored Procedures and Triggers

Change Database Dynamically at Run-Time

Compare Control Values with CompareValidator

Create Reusable Panels

Create a Series of Wizard Pages to Add a Record

Customizing the Data Access Layer

Overriding the GetRecordValues Function

Overriding the InsertRecord Function

Customizing the Default Error Message

Disable ValidationSummary and JavaScript for a Page

Disable View State for a Page

Display Total Records on a Page

Display Detail Tables in a Tabbed Interface

Display PDF, Word or Excel Files

Encrypting Passwords Before Saving to the Database

Get ID of Saved Record in Button Click Handler

Go to a Specific Page in a Table Panel

Handling a Selected Row in a Table

Handling Button Events

Modify a Menu’s RedirectURL Property

Modify and Redirect URL Values Programmatically

Modify Search Field Behavior

Modifying Values before Saving Data

Override the DataBind Method on a Page Class

Override the DataBind Method on a TableControl Class

Override the Delete Button Handler

Perform Special Processing when Logging Out

Redirect to a Page Based on Logged In User

Restrict Login after Incorrect Password Used

Retrieve File Name of an Uploaded File

Retrieve Records with Primary, Non-Primary, and Composite Keys

Set the Default Value of a FieldFilter on a Show Table Page

Set Maximum Dropdown List Size Globally

Upload Files

Upload Files to File System

Use Data Access Classes in Windows Forms Applications

Use RegisterJScriptAlert to Display Messages

Validate Dependent Fields with Custom Validators

Fun with Redirection