This example puts together a user-defined class, struct and enum and it shows how the CSO Gateway handles inheritance and composition. The class PeopleInfo contains 2 properties whose return type is not cso-compatible. One is simply excluded with the CsoPropertyExcludeAttribute code attribute. The other one is also excluded but another property is defined in the CustomerInfo derived class to bring on the client-side a piece of information about the object that the excluded property is returning.

Also notice that all the <script> tags generated by the Importer control are correctly ordered.

CopyPersonInfo class
[CsoGeneratedType]
public abstract class PersonInfo
{
    private const int NAME_MAX_LENGTH = 32;

    private TitleBeforeName personTitle;
    public TitleBeforeName PersonTitle
    {
        get{ return personTitle; }
    }

    private string firstName;
    public string FirstName
    {
        get { return firstName; }
    }

    private string lastName;
    public string LastName
    {
        get { return lastName; }
    }

    private DateTime dateOfBirth;
    public DateTime DateOfBirth
    {
        get { return dateOfBirth; }
    }

    private TimeZone homeTimeZone;
    [CsoPropertyExclude]
    public TimeZone HomeTimeZone
    {
        get { return homeTimeZone; }
    }

    public PersonInfo(TitleBeforeName t, string fn, string ln, DateTime dob, TimeZone tzr)
    {
        personTitle = t;
        firstName = fn;
        lastName = ln;
        dateOfBirth = dob;
        homeTimeZone = tzr;
    }
}
CopyPersonInfo cso-generated class
// ****************************************
// CSO Gateway version 0.7.1.0
// Copyright (C) 2010 Pascal Dufresne
// http://csogateway.codeplex.com
// http://csogateway.metaobjects.ca
// ****************************************
// class DefaultNamespace.PersonInfo
// dynamically generated from class: "PersonInfo, App_Web_mfkbkhsc, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
// ****************************************


Type.registerNamespace('DefaultNamespace');

DefaultNamespace.PersonInfo = function DefaultNamespace$PersonInfo(PersonTitle, FirstName, LastName, DateOfBirth)
{
  this._PersonTitle = PersonTitle;
  this._FirstName = FirstName;
  this._LastName = LastName;
  this._DateOfBirth = DateOfBirth;
}

DefaultNamespace.PersonInfo.NAME_MAX_LENGTH = 32;

// PersonTitle property
DefaultNamespace.PersonInfo.prototype.get_PersonTitle = function DefaultNamespace$PersonInfo$get_PersonTitle()
{
  return this._PersonTitle;
}
DefaultNamespace.PersonInfo.prototype.set_PersonTitle = function DefaultNamespace$PersonInfo$set_PersonTitle(value)
{
  this._PersonTitle = value;
}

// FirstName property
DefaultNamespace.PersonInfo.prototype.get_FirstName = function DefaultNamespace$PersonInfo$get_FirstName()
{
  return this._FirstName;
}
DefaultNamespace.PersonInfo.prototype.set_FirstName = function DefaultNamespace$PersonInfo$set_FirstName(value)
{
  this._FirstName = value;
}

// LastName property
DefaultNamespace.PersonInfo.prototype.get_LastName = function DefaultNamespace$PersonInfo$get_LastName()
{
  return this._LastName;
}
DefaultNamespace.PersonInfo.prototype.set_LastName = function DefaultNamespace$PersonInfo$set_LastName(value)
{
  this._LastName = value;
}

// DateOfBirth property
DefaultNamespace.PersonInfo.prototype.get_DateOfBirth = function DefaultNamespace$PersonInfo$get_DateOfBirth()
{
  return this._DateOfBirth;
}
DefaultNamespace.PersonInfo.prototype.set_DateOfBirth = function DefaultNamespace$PersonInfo$set_DateOfBirth(value)
{
  this._DateOfBirth = value;
}

DefaultNamespace.PersonInfo.registerClass('DefaultNamespace.PersonInfo', CsoGateway.System.CsoGenerated, Sys.IDisposable);
CopyCustomerInfo class
[CsoGeneratedType]
public class CustomerInfo : PersonInfo
{
    private DataTable transactions;
    [CsoPropertyExclude]
    public DataTable Transactions
    {
        get { return transactions; }
    }

    public string HomeTimeZoneName
    {
        get { return HomeTimeZone.StandardName; }
    }

    public Address customerAddress;
    public Address CustomerAddress
    {
        get { return customerAddress; }
    }

    public CustomerInfo(TitleBeforeName t, string fn, string ln, DateTime dob, DataTable transacs, TimeZone tzr, Address adr)
        : base(t, fn, ln, dob, tzr)
    {
        transactions = transacs;
        customerAddress = adr;
    }
}
CopyCustomerInfo cso-generated class
// ****************************************
// CSO Gateway version 0.7.1.0
// Copyright (C) 2010 Pascal Dufresne
// http://csogateway.codeplex.com
// http://csogateway.metaobjects.ca
// ****************************************
// class DefaultNamespace.CustomerInfo
// dynamically generated from class: "CustomerInfo, App_Web_mfkbkhsc, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
// ****************************************


Type.registerNamespace('DefaultNamespace');

DefaultNamespace.CustomerInfo = function DefaultNamespace$CustomerInfo(HomeTimeZoneName, CustomerAddress, PersonTitle, FirstName, LastName, DateOfBirth)
{
  DefaultNamespace.CustomerInfo.initializeBase(this, [PersonTitle, FirstName, LastName, DateOfBirth]);

  this._HomeTimeZoneName = HomeTimeZoneName;
  this._CustomerAddress = CustomerAddress;
}

// HomeTimeZoneName property
DefaultNamespace.CustomerInfo.prototype.get_HomeTimeZoneName = function DefaultNamespace$CustomerInfo$get_HomeTimeZoneName()
{
  return this._HomeTimeZoneName;
}
DefaultNamespace.CustomerInfo.prototype.set_HomeTimeZoneName = function DefaultNamespace$CustomerInfo$set_HomeTimeZoneName(value)
{
  this._HomeTimeZoneName = value;
}

// CustomerAddress property
DefaultNamespace.CustomerInfo.prototype.get_CustomerAddress = function DefaultNamespace$CustomerInfo$get_CustomerAddress()
{
  return this._CustomerAddress;
}
DefaultNamespace.CustomerInfo.prototype.set_CustomerAddress = function DefaultNamespace$CustomerInfo$set_CustomerAddress(value)
{
  this._CustomerAddress = value;
}

DefaultNamespace.CustomerInfo.registerClass('DefaultNamespace.CustomerInfo', DefaultNamespace.PersonInfo, Sys.IDisposable);
CopyAddress struct
[CsoGeneratedType]
public struct Address
{
    public Address(string ad1, string ad2, string zip, string c)
    {
        addressLine1 = ad1;
        addressLine2 = ad2;
        zipCode = zip;
        city = c;
    }

    private string addressLine1;
    public string AddressLine1
    {
        get { return addressLine1; }
    }

    private string addressLine2;
    public string AddressLine2
    {
        get { return addressLine2; }
    }

    private string zipCode;
    public string ZipCode
    {
        get { return zipCode; }
    }

    private string city;
    public string City
    {
        get { return city; }
    }
}
CopyAddress cso-generated class
// ****************************************
// CSO Gateway version 0.7.1.0
// Copyright (C) 2010 Pascal Dufresne
// http://csogateway.codeplex.com
// http://csogateway.metaobjects.ca
// ****************************************
// class DefaultNamespace.Address
// dynamically generated from struct: "Address, App_Web_mfkbkhsc, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
// ****************************************


  Type.registerNamespace('DefaultNamespace');

DefaultNamespace.Address = function DefaultNamespace$Address(AddressLine1, AddressLine2, ZipCode, City)
{
  this._AddressLine1 = AddressLine1;
  this._AddressLine2 = AddressLine2;
  this._ZipCode = ZipCode;
  this._City = City;
}

// AddressLine1 property
DefaultNamespace.Address.prototype.get_AddressLine1 = function DefaultNamespace$Address$get_AddressLine1()
{
  return this._AddressLine1;
}
DefaultNamespace.Address.prototype.set_AddressLine1 = function DefaultNamespace$Address$set_AddressLine1(value)
{
  this._AddressLine1 = value;
}

// AddressLine2 property
DefaultNamespace.Address.prototype.get_AddressLine2 = function DefaultNamespace$Address$get_AddressLine2()
{
  return this._AddressLine2;
}
DefaultNamespace.Address.prototype.set_AddressLine2 = function DefaultNamespace$Address$set_AddressLine2(value)
{
  this._AddressLine2 = value;
}

// ZipCode property
DefaultNamespace.Address.prototype.get_ZipCode = function DefaultNamespace$Address$get_ZipCode()
{
  return this._ZipCode;
}
DefaultNamespace.Address.prototype.set_ZipCode = function DefaultNamespace$Address$set_ZipCode(value)
{
  this._ZipCode = value;
}

// City property
DefaultNamespace.Address.prototype.get_City = function DefaultNamespace$Address$get_City()
{
  return this._City;
}
DefaultNamespace.Address.prototype.set_City = function DefaultNamespace$Address$set_City(value)
{
  this._City = value;
}

DefaultNamespace.Address.registerClass('DefaultNamespace.Address', CsoGateway.System.CsoGenerated, Sys.IDisposable);
CopyTitleBeforeName enum
[CsoGeneratedType("MyEnums")]
public enum TitleBeforeName
{
    Mr=0,
    Mrs=1,
    Ms=2,
    Miss=3
}
CopyTitleBeforeName cso-generated enum
// ****************************************
// CSO Gateway version 0.7.1.0
// Copyright (C) 2010 Pascal Dufresne
// http://csogateway.codeplex.com
// http://csogateway.metaobjects.ca
// ****************************************
// enum MyEnums.TitleBeforeName
// dynamically generated from enum: "TitleBeforeName, App_Web_mfkbkhsc, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
// ****************************************


Type.registerNamespace('MyEnums');

MyEnums.TitleBeforeName = function(){};
MyEnums.TitleBeforeName.prototype = 
{
  Mr:0,
  Mrs:1,
  Ms:2,
  Miss:3
}

MyEnums.TitleBeforeName.registerEnum('MyEnums.TitleBeforeName');
CopyCustomerInfo object
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using ca.metaobjects.csogateway;
using ca.metaobjects.csogateway.Controls;

public partial class LearnByExamples_Example10 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Address anAddress = new Address("234 Ste-Catherine St.", "3rd floor, room 110", "92830", "New York");
        CustomerInfo info = new CustomerInfo(TitleBeforeName.Mr, "Guy", "Lafleur", new DateTime(1954, 2, 24), new DataTable(), TimeZone.CurrentTimeZone, anAddress);

        objectGateway1.SourceObject = info;
    }
}
CopyResult in browser
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
    Learn by examples #10
</title>
<script type="text/javascript" src="csogateway.axd?import=MicrosoftAjax.js"></script>
<script type="text/javascript" src="csogateway.axd?import=CsoGatewayGlobalFunctions.js"></script>
<script type="text/javascript" src="csogateway.axd?import=CsoGateway.System.js"></script>
<script type="text/javascript" src="csogateway.axd?import=((DefaultNamespace.PersonInfo)(PersonInfo%2c+App_Web_4lv0sv9c%2c+Version%3d0.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3dnull))"></script>
<script type="text/javascript" src="csogateway.axd?import=((DefaultNamespace.Address)(Address%2c+App_Web_4lv0sv9c%2c+Version%3d0.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3dnull))"></script>

<script type="text/javascript" src="csogateway.axd?import=((MyEnums.TitleBeforeName)(TitleBeforeName%2c+App_Web_4lv0sv9c%2c+Version%3d0.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3dnull))"></script>
<script type="text/javascript" src="csogateway.axd?import=((DefaultNamespace.CustomerInfo)(CustomerInfo%2c+App_Web_4lv0sv9c%2c+Version%3d0.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3dnull))"></script>
</head>
<body>
    <form name="form1" method="post" action="Example10.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTczMjkxMjkxMGQYAgUOb2JqZWN0R2F0ZXdheTEPBdwBbmV3IERlZmF1bHROYW1lc3BhY2UuQ3VzdG9tZXJJbmZvKCdFYXN0ZXJuIFN0YW5kYXJkIFRpbWUnLG5ldyBEZWZhdWx0TmFtZXNwYWNlLkFkZHJlc3MoJzIzNCBTdGUtQ2F0aGVyaW5lIFN0LicsJzNyZCBmbG9vciwgcm9vbSAxMTAnLCc5MjgzMCcsJ05ldyBZb3JrJyksTXlFbnVtcy5UaXRsZUJlZm9yZU5hbWUuTXIsJ0d1eScsJ0xhZmxldXInLG5ldyBEYXRlKC01MDAyMzgwMDAwMDApKWQFCWltcG9ydGVyMQ8yohQAAQAAAP////8BAAAAAAAAAAwCAAAAUGNhLm1ldGFvYmplY3RzLmNzb2dhdGV3YXksIFZlcnNpb249MC43LjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsBQEAAAA0Y2EubWV0YW9iamVjdHMuY3NvZ2F0ZXdheS5SZWZsZWN0aW9uLkRlcGVuZGVuY3lHcmFwaAIAAAALZGVzY3JpcHRvcnMMZGVwZW5kZW5jaWVzAwO8AVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbY2EubWV0YW9iamVjdHMuY3NvZ2F0ZXdheS5SZWZsZWN0aW9uLkRlcGVuZGVuY3lHcmFwaCtTY3JpcHREZXNjcmlwdG9yLC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m8pKFBlcnNvbkluZm8sIEFwcF9XZWJfNGx2MHN2OWMsIFZlcnNpb249MC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsKSkBCQAAAAcAAAAB7f////H///8ABhQAAAAUQ3NvR2F0ZXdheS5TeXN0ZW0uanMBCgAAAAcAAAAB6/////H///8BBhYAAAB1KChNeUVudW1zLlRpdGxlQmVmb3JlTmFtZSkoVGl0bGVCZWZvcmVOYW1lLCBBcHBfV2ViXzRsdjBzdjljLCBWZXJzaW9uPTAuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbCkpAQsAAAAHAAAAAen////x////AQYYAAAAbigoRGVmYXVsdE5hbWVzcGFjZS5BZGRyZXNzKShBZGRyZXNzLCBBcHBfV2ViXzRsdjBzdjljLCBWZXJzaW9uPTAuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbCkpBQwAAABFY2EubWV0YW9iamVjdHMuY3NvZ2F0ZXdheS5SZWZsZWN0aW9uLkRlcGVuZGVuY3lHcmFwaCtTY3JpcHREZXBlbmRlbmN5AgAAAAVzdGFydANlbmQEBEVjYS5tZXRhb2JqZWN0cy5jc29nYXRld2F5LlJlZmxlY3Rpb24uRGVwZW5kZW5jeUdyYXBoK1NjcmlwdERlc2NyaXB0b3ICAAAARWNhLm1ldGFvYmplY3RzLmNzb2dhdGV3YXkuUmVmbGVjdGlvbi5EZXBlbmRlbmN5R3JhcGgrU2NyaXB0RGVzY3JpcHRvcgIAAAACAAAACQgAAAAJCQAAAAENAAAADAAAAAkHAAAACQgAAAABDgAAAAwAAAAJCwAAAAkJAAAAC2QJZBxu9v0gTIJ1TP/3QZxoO1tdbw==" />
</div>

        <div>
            <script type="text/javascript">var aCustomerInfo = new DefaultNamespace.CustomerInfo('Eastern Standard Time',new DefaultNamespace.Address('234 Ste-Catherine St.','3rd floor, room 110','92830','New York'),MyEnums.TitleBeforeName.Mr,'Guy','Lafleur',new Date(-500238000000));</script>

        </div>
    </form>
</body>
</html>