Ektron CMS400.Net Reference

>>Managing Content > Displaying Content on your Web Site > Using the ContentBlock Server Control Programmatically Example

Using the ContentBlock Server Control Programmatically

The following code will display a content block:

Note: Before adding these lines of code, drag and drop a literal box on your Web form.

Dim MyContentBlock As New ContentBlock

MyContentBlock.DefaultContentID = 8

MyContentBlock.Page = Page

MyContentBlock.Fill()

Literal1.Text = MyContentBlock.EkItem.Html

To display a content block with the content block title, do the following:

Note: Before adding these lines of code, drag and drop a two literal boxes on your Web form.

Dim MyContentBlock As New ContentBlock

MyContentBlock.DefaultContentID = 8

MyContentBlock.Page = Page

MyContentBlock.Fill()

Literal1.Text = MyContentBlock.EkItem.Title

Literal2.Text = MyContentBlock.EkItem.Html


Visit the Ektron Dev Center at http://dev.ektron.com 1-866 - 4 - EKTRON

Ektron CMS400.NET Reference Version 8.02 SP1 Rev 1

Ektron Documentation,© 2011 Ektron, Inc.