This trivial example show how to use an ObjectGateway control to send a System.DateTime value on the client side. Notice the two script that are always imported by the Importer control.

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="/wEPDwUKLTczMjkxMjkxMGQY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uMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsXV0DAAAABl9pdGVtcwVfc2l6ZQhfdmVyc2lvbgQAAEdjYS5tZXRhb2JqZWN0cy5jc29nYXRld2F5LlJlZmxlY3Rpb24uRGVwZW5kZW5jeUdyYXBoK1NjcmlwdERlc2NyaXB0b3JbXQIAAAAICAkFAAAAAAAAAAAAAAAEBAAAALwBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tjYS5tZXRhb2JqZWN0cy5jc29nYXRld2F5LlJlZmxlY3Rpb24uRGVwZW5kZW5jeUdyYXBoK1NjcmlwdERlcGVuZGVuY3ksIGNhLm1ldGFvYmplY3RzLmNzb2dhdGV3YXksIFZlcnNpb249MC43LjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsXV0DAAAABl9pdGVtcwVfc2l6ZQhfdmVyc2lvbgQAAEdjYS5tZXRhb2JqZWN0cy5jc29nYXRld2F5LlJlZmxlY3Rpb24uRGVwZW5kZW5jeUdyYXBoK1NjcmlwdERlcGVuZGVuY3lbXQIAAAAICAkGAAAAAAAAAAAAAAAHBQAAAAABAAAAIAAAAARFY2EubWV0YW9iamVjdHMuY3NvZ2F0ZXdheS5SZWZsZWN0aW9uLkRlcGVuZGVuY3lHcmFwaCtTY3JpcHREZXNjcmlwdG9yAgAAAA0gBwYAAAAAAQAAAEAAAAAERWNhLm1ldGFvYmplY3RzLmNzb2dhdGV3YXkuUmVmbGVjdGlvbi5EZXBlbmRlbmN5R3JhcGgrU2NyaXB0RGVwZW5kZW5jeQIAAAANQAtk7DWPpLX40LanSKq7pIM00Pn6wxE=" />

</div>

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