This section explains what must be done to prepare your ASP.NET pages to use the CSO Gateway. At this point, your web project should have a reference to the CSO Gateway DLL (ca.metaobjects.csogateway.dll). If not go back to the Installation Guide

Preparing your ASP.NET pages

The CSO Gateway works with two ASP.NET web controls that you add to your ASP.NET page. To prepare your webpage to use the CSO Gateway go through the following steps:

Register the web controls namespace

Add a Register directive at the top of your ASP.NET page to import the CSO Gateway controls. Just above or below the Page directive is acceptable.

<%@ Register Assembly="ca.metaobjects.csogateway" Namespace="ca.metaobjects.csogateway.Controls" TagPrefix="cso" %>

Add the Importer control

Add the Importer control on the page. The correct place to put this control is inside the HEAD tag. If you are also using ASP.NET AJAX on this page, you must put the Importer control after the ScriptManager control and you must put the ImportMsAjaxScripts property to false.

<cso:Importer ID="importer1" ImportMsAjaxScripts="true" runat="server" ></cso:Importer>

Add one or more ObjectGateway control

You will be using at least one ObjectGateway control. This control can be placed anywhere inside the form tag.

<cso:ObjectGateway ID="objectGateway1" VariableNameOnClientSide="myObject" runat="server" />

Import the Controls namespace

You can now go to the codebehind and import the Controls namespace with the following statement:

C# Copy
using ca.metaobjects.csogateway.Controls;

The only thing left to do is to go in the codebehind and assign a cso-compatible object to the ObjectGateway control. If the object is simple enough, there will be no additional work necessary. Otherwise, you might have to add a few code attributes to your type definitions. See Passing objects in the Object Gateway