15.08.2013 Views

Ektron CMS400.NET Developer Reference Manual

Ektron CMS400.NET Developer Reference Manual

Ektron CMS400.NET Developer Reference Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Introduction to <strong>Ektron</strong> <strong>CMS400.NET</strong> Server Controls<br />

page 29), you can insert one programmatically. You might prefer to<br />

insert server controls programmatically for several reasons, such<br />

as<br />

• you want the control to be loaded into memory only under<br />

certain conditions. In this case, insert the logic that only<br />

displays the control if the condition exists.<br />

• you want to display only certain properties of an object, such as<br />

the title of last edited date of a content block.<br />

Note that you can drag and drop controls on your page then<br />

customize them using code behind. For more information,<br />

see:”Using Drag & Drop and Programmatically Together” on<br />

page 51.<br />

The following sections explain how to use the server controls<br />

programmatically.<br />

• ”Steps to Insert a Server Control Programmatically” on page 34<br />

• ”Server Control Properties in Code Behind” on page 38<br />

• ”Customizing Server Controls” on page 48<br />

Steps to Insert a Server Control Programmatically<br />

To insert an <strong>Ektron</strong> server control programmatically, follow these<br />

steps.<br />

”Step 1: Declare the Namespace” on page 35<br />

”Step 2: Create an Instance of the New Control” on page 35<br />

”Step 3: Set the Properties” on page 36<br />

”Step 4: Call the Fill Method” on page 37<br />

”Step 5: Use .text Property to Display the Control” on page 37<br />

Each step is described below. These steps show an example of<br />

using the Collection Server Control.<br />

<strong>Ektron</strong> <strong>CMS400.NET</strong> <strong>Developer</strong> <strong>Reference</strong> <strong>Manual</strong>, Version 5.1, Revision 5 34

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!