Kentico CMS 6.0 Controls

Getting started

Getting started

Previous topic Next topic Mail us feedback on this topic!  

Getting started

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

The following tutorial will show you how to display the document name of the currently selected document using the CMSDocumentValue control:

 

1. Create a new Web form and use it as a page template according to the guide in the Using ASPX page templates topic.

 

2. Switch to its Design tab, drag and drop a CMSDocumentValue control from the toolbox onto the form and set its following properties:

 

AttributeName: DocumentName

FormattingString: Document name: {0}

 

This tells the control which document value to display and sets the format that should be used.

 

The code of the control will look like this:

 

<cms:CMSDocumentValue ID="CMSDocumentValue1" runat="server" AttributeName="DocumentName" FormattingString="Document name: {0}" />

 

3. Save the changes to the web form. Now if you look at the page using the created template on some website, the name of the currently selected document will be displayed. This is only an example of how this control can be used and by itself isn't very useful. In a practical scenario, the code of the control from this example would be added to an existing ASPX page template, that has some other function, or to the code of a page layout when using the portal engine.