Many types from the .NET Framework are handled directly by the CSO Gateway, you do not have to provide any conversion logic or anything of that kind. A complete list of these types is available in the Reference section. This list includes all primitive types, many commonly used classes and structures like System..::.DateTime and System..::.Array, many collections from System.Collections and System.Collections.Generic namespaces and all enums.

These types are all cso-compatible types. The general rule is that instances of cso-compatible types are cso-compatible objects but there are exceptions.

This topic contains the following sections.

Trivial example with System.DateTime

This is example #1 from the Learn by examples section. It illustrates the most trivial way the CSO Gateway can be used.

CopyASPX file
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Example01.aspx.cs" Inherits="LearnByExamples_Example01" %>
<%@ Register Assembly="ca.metaobjects.csogateway" Namespace="ca.metaobjects.csogateway.Controls" TagPrefix="cso" %>

<!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 runat="server">
    <title>Learn by examples #1</title>
    <cso:Importer ID="importer1" MsAjaxLibraryVersion="v3_5" runat="server" ></cso:Importer>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <cso:ObjectGateway ID="objectGateway1" VariableNameOnClientSide="myBirthday" runat="server" />
        </div>
    </form>
</body>
</html>
<%
CopyCodebehind file
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.Controls;

public partial class LearnByExamples_Example01 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        DateTime theDayIwasBorn = new DateTime(1980, 1, 1);

        objectGateway1.SourceObject = theDayIwasBorn;
    }
}
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 #1
</title>
<script type="text/javascript" src="csogateway.axd?import=MicrosoftAjax.js"></script>
<script type="text/javascript" src="csogateway.axd?import=CsoGatewayGlobalFunctions.js"></script>
</head>
<body>
    <form name="form1" method="post" action="Example1.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTczMjkxMjkxMGQYAgUOb2JqZWN0R2F0ZXdheTEPBRZuZXcgRGF0ZSgzMTU1NTA4MDAwMDApZAUJaW1wb3J0ZXIxDzL3CgABAAAA/////wEAAAAAAAAADAIAAABQY2EubWV0YW9iamVjdHMuY3NvZ2F0ZXdheSwgVmVyc2lvbj0wLjcuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAADRjYS5tZXRhb2JqZWN0cy5jc29nYXRld2F5LlJlZmxlY3Rpb24uRGVwZW5kZW5jeUdyYXBoAgAAAAtkZXNjcmlwdG9ycwxkZXBlbmRlbmNpZXMDA7wBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tjYS5tZXRhb2JqZWN0cy5jc29nYXRld2F5LlJlZmxlY3Rpb24uRGVwZW5kZW5jeUdyYXBoK1NjcmlwdERlc2NyaXB0b3IsIGNhLm1ldGFvYmplY3RzLmNzb2dhdGV3YXksIFZlcnNpb249MC43LjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsXV28AVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbY2EubWV0YW9iamVjdHMuY3NvZ2F0ZXdheS5SZWZsZWN0aW9uLkRlcGVuZGVuY3lHcmFwaCtTY3JpcHREZXBlbmRlbmN5LCBjYS5tZXRhb2JqZWN0cy5jc29nYXRld2F5LCBWZXJzaW9uPTAuNy4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAgAAAAkDAAAACQQAAAAEAwAAALwB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wZW5kZW5jeQIAAAANQAtk7DWPpLX40LanSKq7pIM00Pn6wxE=" />

</div>

        <div>
            <script type="text/javascript">var myBirthday = new Date(315550800000);</script>
        </div>
    </form>
</body>
</html>

Since System.DateTime is a type handled directly by the CSO Gateway, no action other than assigning the theDayIwasBorn object to the SourceObject property of the ObjectGateway control was necessary.

Notice that the Importer control generated 2 script tags for external scripts: MicrosoftAjax.js and CsoGatewayGlobalFunctions.js. These 2 scripts are imported by default by the Importer. They are needed by the CSO Gateway to function correctly (this case being an exception because it is so trivial).

Example with a collection handled with a cso-native type

This is example #6 from the Learn by examples section. The Dictionary<(Of <(TKey, TValue>)>) type is handled by a cso-native type from the Native Type Library of the CSO Gateway. Notice that the Importer control automatically detects that the CsoGateway.Collections.Dictionary.js file is needed because it contains the CsoGateway.Collections.Dictionary type. The CsoGateway.Collections.Hashing.js and the CsoGateway.System.js file are also imported because CsoGateway.Collections.Dictionary depends on them: it needs the hashing function in CsoGateway.Collections.Hashing.js to compute the hashes of the keys and CsoGateway.System.js because it contains the CsoGateway.System.CsoNative class that is the base class of CsoGateway.Collections.Dictionary.

CopyASPX file
<form id="form1" runat="server">
    <div>
        <cso:ObjectGateway ID="objectGateway1" VariableNameOnClientSide="myFriendsBirthday" runat="server" />
    </div>
</form>
<%
CopyCodebehind file
protected void Page_Load(object sender, EventArgs e)
{
    Dictionary<String, DateTime> birthdayDict = new Dictionary<String, DateTime>();

    birthdayDict.Add("Sean", new DateTime(1982,3,14));
    birthdayDict.Add("Ben", new DateTime(1974, 12, 26));
    birthdayDict.Add("Jerry", new DateTime(1934, 9, 4));

    objectGateway1.SourceObject = birthdayDict;
}
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 #6
</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=CsoGateway.Collections.Hashing.js"></script>
<script type="text/javascript" src="csogateway.axd?import=CsoGateway.Collections.Dictionary.js"></script>

</head>
<body>

    <form name="form1" method="post" action="Example6.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTczMjkxMjkxMGQYAgUOb2JqZWN0R2F0ZXdheTEPBYIBbmV3IENzb0dhdGV3YXkuQ29sbGVjdGlvbnMuRGljdGlvbmFyeSgnU2VhbicsbmV3IERhdGUoMzg0OTMwMDAwMDAwKSwnQmVuJyxuZXcgRGF0ZSgxNTcyNjYwMDAwMDApLCdKZXJyeScsbmV3IERhdGUoLTExMTQ4MDQ4MDAwMDApKWQFCWltcG9ydGVyMQ8y3BAAAQAAAP////8BAAAAAAAAAAwCAAAAUGNhLm1ldGFvYmplY3RzLmNzb2dhdGV3YXksIFZlcnNpb249MC43LjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsBQEAAAA0Y2EubWV0YW9iamVjdHMuY3NvZ2F0ZXdheS5SZWZsZWN0aW9uLkRlcGVuZGVuY3lHcmFwaAIAAAALZGVzY3JpcHRvcnMMZGVwZW5kZW5jaWVzAwO8AVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbY2EubWV0YW9iamVjdHMuY3NvZ2F0ZXdheS5SZWZsZWN0aW9uLkRlcGVuZGVuY3lHcmFwaCtTY3JpcHREZXNjcmlwdG9yLCBjYS5tZXRhb2JqZWN0cy5jc29nYXRld2F5LCBWZXJzaW9uPTAuNy4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dvAFTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbW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9iamVjdHMuY3NvZ2F0ZXdheS5SZWZsZWN0aW9uLkRlcGVuZGVuY3lHcmFwaCtTY3JpcHREZXNjcmlwdG9yAgAAAAIAAAAJBwAAAAkIAAAAAQsAAAAKAAAACQkAAAAJCAAAAAEMAAAACgAAAAkHAAAACQkAAAALZC6kTtjubJcsFW4exwW0fgIargFn" />
</div>

        <div>
            <script type="text/javascript">var myFriendsBirthday = new CsoGateway.Collections.Dictionary('Sean',new Date(384930000000),'Ben',new Date(157266000000),'Jerry',new Date(-1114804800000));</script>
        </div>
    </form>


</body>
</html>

Example with an enum: System.DayOfWeek

Enums of the .NET Framework are handled by cso-generated enums that are dynamically generated by the Type Morpher as needed. All enums are cso-ready by default so there is nothing to do for you. Below is example #5 from the Learn by examples section.

CopyASPX file
<form id="form1" runat="server">
    <div>
        <cso:ObjectGateway ID="objectGateway1" VariableNameOnClientSide="todaysDayOfTheWeek" runat="server" />
    </div>
</form>
<%
CopyCodebehind file
public partial class LearnByExamples_Example05 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        DayOfWeek today = DateTime.Today.DayOfWeek;

        objectGateway1.SourceObject = today;
    }
}
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 #5
</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=((DefaultNamespace.DayOfWeek)(System.DayOfWeek%2c+mscorlib%2c+Version%3d2.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3db77a5c561934e089))"></script>
</head>
<body>

    <form name="form1" method="post" action="Example5.aspx" id="form1">

<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTczMjkx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ZXNjcmlwdG9yBAFDY2EubWV0YW9iamVjdHMuY3NvZ2F0ZXdheS5SZWZsZWN0aW9uLkRlcGVuZGVuY3lHcmFwaCtEZXNjcmlwdG9yVHlwZQIAAAACAAAABfj///9DY2EubWV0YW9iamVjdHMuY3NvZ2F0ZXdheS5SZWZsZWN0aW9uLkRlcGVuZGVuY3lHcmFwaCtEZXNjcmlwdG9yVHlwZQEAAAAHdmFsdWVfXwACAgAAAAEGCQAAAIcBKChKYXZhc2NyaXB0RGVmYXVsdE5hbWVzcGFjZS5EYXlPZldlZWspKFN5c3RlbS5EYXlPZldlZWssIG1zY29ybGliLCBWZXJzaW9uPTIuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OSkpC2RhFz5TeYA9JCf+6b8jQq9SXqfvRw==" />
</div>

        <div>
            <script type="text/javascript">var todaysDayOfTheWeek = DefaultNamespace.DayOfWeek.Wednesday;</script>
        </div>
    </form>

</body>
</html>

Notice that the Importer control has generated a third script tag after the two that are always there by defaults. This is the tag that imports the cso-generated enum created from System.DayOfWeek. The javascript code definition of this cso-generated enum is as follow:

CopyCso-generated enum DefaultNamespace.DayOfWeek
// ****************************************
// CSO Gateway version 0.7.1.0
// Copyright (C) 2010 Pascal Dufresne
// http://csogateway.codeplex.com
// http://csogateway.metaobjects.ca
// ****************************************
// enum DefaultNamespace.DayOfWeek
// dynamically generated from enum: "System.DayOfWeek, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
// ****************************************


Type.registerNamespace('DefaultNamespace');

DefaultNamespace.DayOfWeek = function(){};
DefaultNamespace.DayOfWeek.prototype = 
{
  Sunday:0,
  Monday:1,
  Tuesday:2,
  Wednesday:3,
  Thursday:4,
  Friday:5,
  Saturday:6
}

DefaultNamespace.DayOfWeek.registerEnum('DefaultNamespace.DayOfWeek');

The cso-generated enum is in namespace DefaultNamespace because this is what was specified as the default namespace in the configuration.